How do I select all rows and columns that have data then filter with multiple criteria?
I recorded a macro.
Sheet2.Activate
Sheet2.Range("$A$1:$L$85").AutoFilter Field:=12, Criteria1:=Array( _
"Apples", "Pineapple", "Oranges", "Mango", "Grapes", _
"Banana", "Papaya"), Operator:=xlFilterValues
Columns("A:L").Select
Selection.copy
Sheets("Food").Select
Range("A:L").Select
Sheet7.Paste'
I want to select all the data in A1 to L1. But my code is only for specific number of rows and columns. If the data changes from $A$1:$L$85
and goes more than 85 rows and more than the column L, it will not capture all the data that needs to be filtered.