I have a worksheet with an autofiltered range that starts in cell B3 . Column A contains several macros, but is actually empty. The upper two lines contain information about the data in the main range.
In VBA, I use what I consider to be the standard method for determining the last row in a worksheet (in this case, I cannot rely on the .End method in one column):
LastRow = Activesheet.Cells.Find("*",SearchOrder:=xlByRows,SearchDirection:=xlPrevious).Row
However, sometimes this returns the value of one, even if I have thousands of rows of data. It seems that this happens only when filters are installed (but they still have visible rows with data), but even then this does not always happen, and I do not see a template in it.
I know that there are other solutions - instead, I changed the UsedRange method, but it is very difficult that this particular one fails, because otherwise it would be most effective in this situation.
Does anyone know why this is happening?
source share