I don't have enough reputation to comment on the original post so I think I have to ask here... Excel VBA - filter rows within dynamic range I'm trying to change my VBA to filter rows with dynamic ranges. My code is below but I'm not sure what to change it to?
ActiveSheet.Range("$A$1:$K$18791").AutoFilter Field:=8, Criteria1:=Array( _
"Custom", "Health & Welfare", "Insurance", "Retirement & Savings"), Operator:= _
xlFilterValues
I see from the other post the reply has
ActiveSheet.UsedRange.AutoFilter Field:=10, Criteria1:="FALSE"
Would my code be;
ActiveSheet.UsedRange.AutoFilter Field:=8, Criteria1:=Array( _
"Custom", "Health & Welfare", "Insurance", "Retirement & Savings"), Operator:= _
xlFilterValues
My main question is when ".UsedRange" is used, do I have to set the range first? Could someone provide me with the edits I need if needed? In short, I'm trying to filter column K by the criteria but it doesn't end in row 18791 each week so I'm trying to make sure my code grabs the varying data each week.