Forum Discussion
DarrylH42022
Apr 18, 2022Copper Contributor
AutoFit including first row which does not match filter. How to correct?
Greetings,
Running Excel 2013. Have created a large vba macro to "edit" a worksheet.
Using
ActiveSheet.Range("A1:A" & lastRow).AutoFilter Field:=1, Criteria1:="=#*", VisibleDropDown:=False
To filter so I can delete rows that have a part number starting with #. The issue is that when the filter is applied, it includes the first row which does not have a part number starting with #. I am sure that I am not understanding some aspect of the AutoFilter. Can someone point out what I missed ?
Example of problem:
After applying Autofilter, I will get
part1
#part32
#part43
#part61
part1 should not be shown.
Thanks.
1 Reply
AutoFilter always treats the first row of the range as a header row, so that row will never be filtered.