I have a worksheet with an autofiltered range that starts in cell B3
. Column A
contains some macro buttons but is effectively blank. The top two rows contain information about the data in the main range.
In VBA, I am using what I believe is a standard method for determining the last row in a worksheet (In this case I cannot rely on the .End
method on a single column):
LastRow = Activesheet.Cells.Find("*",SearchOrder:=xlByRows,SearchDirection:=xlPrevious).Row
However, sometimes this returns a value of one, even when I have thousands of rows of data. It seems to only do this when there are filters set (but there are still visible rows with data in them), but even then it doesn't always happen and I can't see a pattern to it.
I know there are other solutions - I have changed to a UsedRange
technique instead, but it is very frustrating that this particular one fails as it would otherwise be the most effective one in this situation.
Does anyone know why this would be happening?
Lookin:=xlValues
in yourFind
call (or if it is all formulas switch over toxlFormulas
)? – CuberChase