Mattandy55
New Member
- Joined
- May 27, 2016
- Messages
- 20
Hi all,
I have the below code:
ActiveCell.AutoFilter Field:=9, Criteria1:="<>"
ActiveSheet.AutoFilter.Range.Offset(6, 0).Rows.SpecialCells(xlCellTypeVisible).Delete
I am using it on multiple worksheets and it seems to work fine on the first two, but when I get to the third sheet I have an issue. What is happening is its filtering properly, my column headers are row 6, and sheet 3 has 4 records. So the code filters to row 11 and beyond, but when the delete aspect of the code kicks in, it leaves row 11 and deletes rows starting at row 12. Any idea why its not deleting the first row when the code runs? I'm a little stumped just because it works and deletes rows correctly on the first 2 sheets it runs on.
Thank you
I have the below code:
ActiveCell.AutoFilter Field:=9, Criteria1:="<>"
ActiveSheet.AutoFilter.Range.Offset(6, 0).Rows.SpecialCells(xlCellTypeVisible).Delete
I am using it on multiple worksheets and it seems to work fine on the first two, but when I get to the third sheet I have an issue. What is happening is its filtering properly, my column headers are row 6, and sheet 3 has 4 records. So the code filters to row 11 and beyond, but when the delete aspect of the code kicks in, it leaves row 11 and deletes rows starting at row 12. Any idea why its not deleting the first row when the code runs? I'm a little stumped just because it works and deletes rows correctly on the first 2 sheets it runs on.
Thank you