How do you find the last row of data when the data on your worksheet is filtered? I play with Special Cells and Visible Cells but cannot find a solution. I think it should be some kind of variation on what I have below:
... With ws LR = .Range("A" & Rows.Count).End(xlUp).Row .Range("A1:E" & LR).AutoFilter Field:=2, Criteria1:="=4" LRfilt = .Range("A" & Rows.SpecialCells(xlCellTypeVisible).Count).End(xlUp).Row Debug.Print LR Debug.Print LRfilt End With ...
The file can be found here:
wikisend.com/download/443370/FindLRFilteredData.xls
Edit:
Having realized after a discussion with Siddhart, I did not want the Last Row property to be needed to find the counter of the number of visible lines that led to the Sid solution below ...
source share