Hi there
I am trying to run a row delete macro on all worksheets in an Excel document and I can't get it to work. I tried select all sheets and running the macro and all creating a loop and running it but the only thing that seems to be working is the row unhide and not the delete rows based on a cell Value. It's only grabbing the first worksheet and running the delete row based on cell value. Can anyone help? Here is the start of my macro.
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
.Rows("1:5000").Hidden = False
End With
Next ws
For Each ws In ActiveWorkbook.Worksheets
With ws
With Range("D1", Range("D" & Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:="*SOLD*"
.Offset(1).EntireRow.Delete
.AutoFilter
End With
Next ws
End Sub
End Sub
Bookmarks