Lovelylou79
New Member
- Joined
- Sep 4, 2017
- Messages
- 37
Hi All,
I have the following code that filters a sheet then deletes the visible rows. The problem is, it takes a very long time to run.
'Deletes "Comments:" rows with Auto Filter
With ActiveSheet
.AutoFilterMode = False
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Comments:*"
On Error Resume Next
.offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
The "Comments' Row first appears at row 7 then every 6th row after that, ie; 7, 13, 19, 25.
Ideally I'd like the Comments rows and the row below it be deleted.
Is there a code or an alteration to my current code that can speed up the process?
Thank you in advance,
I have the following code that filters a sheet then deletes the visible rows. The problem is, it takes a very long time to run.
'Deletes "Comments:" rows with Auto Filter
With ActiveSheet
.AutoFilterMode = False
With Range("A1", Range("A" & Rows.Count).End(xlUp))
.AutoFilter 1, "*Comments:*"
On Error Resume Next
.offset(1).SpecialCells(12).EntireRow.Delete
End With
.AutoFilterMode = False
End With
The "Comments' Row first appears at row 7 then every 6th row after that, ie; 7, 13, 19, 25.
Ideally I'd like the Comments rows and the row below it be deleted.
Is there a code or an alteration to my current code that can speed up the process?
Thank you in advance,