Excel vba find xlvalues not working as expected
Posted on 2013-11-14
I am working on a spreadsheet, which has lots of formulas that look up data from other worksheets and I now need to copy the resulting values to another worksheet.
I have used the following code, which works correctly on my test workbook where it correctly finds the last resulting value despite there being formulas further down.
LastRow = Cells.Find(What:="*", after:=[A1], _
'Search for any entry, by searching backwards by Columns.
LastColumn = Cells.Find(What:="*", after:=[A1], _
tlastrow = tlastrow + LastRow
However, when I transfer the code to the live workbook, it doesn't correctly find the last value. The cell that it finds has no data at all along the row (other than a formula) and I cannot see any reason for it finding the cell that it does, other than possible formatting issues. There is a definite difference in the way in which the find function is working between the two spreadsheets
I will send both spreadsheets directly as required.