I am trying to get code to select all the filtered rows from Y to AO minus the headers. Currently here is my code:
With ActiveSheet lr = .Columns("Y:AO").Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
If lr > 1 Then .Range(.Cells(2, "Y"), .Cells(lr, "AO")).Select
End With
This code works perfectly when no rows are filtered out, however whenever I have rows filtered it doesn't go to the then portion of the code. Any suggestions?
With ActiveSheet lr = .Columns("Y:AO").Find(What:="*", SearchDirection:=xlPrevious, SearchOrder:=xlByRows).Row
If lr > 1 Then .Range(.Cells(2, "Y"), .Cells(lr, "AO")).Select
End With
This code works perfectly when no rows are filtered out, however whenever I have rows filtered it doesn't go to the then portion of the code. Any suggestions?