Hi I am trying to delete the rows that doesn't have a fill in them for each worksheet.
I keep running into an "Autofilter method of Range Class Failed" error and I am not sure what is wrong.
It works fine on a single sheet, but when I tried to do it for each worksheet I get this error.
Sub Macro2()
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
WS.Range("A:G").AutoFilter Field:=6, Operator:= _
xlFilterNoFill
WS.Range(WS.Range("G1").Offset(1, 0), WS.Range("G1").Offset(1, 0).End(xlDown)).EntireRow.Delete
WS.Range("A:G").AutoFilter Field:=6, Operator:= _
xlFilterNoFill
Next WS
End Sub
I have attached a sample workbook of what I am trying to do
sample filtering.xlsm
Bookmarks