Hello,
I have some code I use to auto filter a spreadsheet with 2 criteria and in two sections. The problem is I don't know how big the data will be and I currently have it set for 1 million rows but will often need more, if I set it for 1.5 million, if I don't have that many rows I get an error. Is there a way to ensure I count the rows and then apply the autofilter to the exact amount of rows I need? Below is the code I am using:
ActiveSheet.Range("$A$1:$Q$1000001").AutoFilter Field:=14, Criteria1:=Array( _
"Cashback", "Cheque Cashing", "Deposit", "End Of Customer Session", "FX Deposit", _
"FX Make Change", "FX Withdrawal", "Make Change", "Withdrawal"), Operator:= _
xlFilterValues
Range("A1").Select
ActiveSheet.Range("$A$1:$Q$1000001").AutoFilter Field:=1, Criteria1:="<>"
Bookmarks