I usually use the macro recorder to get code like this:
ActiveSheet.Range("$A$1:$C$39").AutoFilter Field:=2, Criteria1:= _
"Sandra Loya"
When I run the macro, the data will vary in length, so I must change the bottom cell reference. So far I have just changed it to be a really low cell so that it will always cover a larger range than my data.
ActiveSheet.Range("$A$1:$C$8000").AutoFilter Field:=2, Criteria1:= _
"Sandra Loya"
But is there an easy way to have the macro automatically reset the range to the bottom of the current data? Something like this:
ActiveSheet.Range("A1.CurrentRegion").AutoFilter Field:=2, Criteria1:= _
"Sandra Loya"
Bookmarks