K
Kirk P.
I'm trying to loop through all worksheets in the active workbook, then loop
through each row in the worksheet and delete all rows with zero in column AA.
I'm having trouble with syntax - here's what I've got:
Sub DeleteRowsTest()
Dim w As Worksheet
Dim FirstRow, LastRow, CurRow As Integer
Dim col As String
FirstRow = 5
LastRow = 20000
col = "AA"
For Each w In Worksheets
For CurRow = LastRow To FirstRow Step -1
If w.Cells(CurRow, col) = 0 Then
w.Rows(CurRow).Delete
Next CurRow
Exit For
Next
End Sub
Help!!!!
through each row in the worksheet and delete all rows with zero in column AA.
I'm having trouble with syntax - here's what I've got:
Sub DeleteRowsTest()
Dim w As Worksheet
Dim FirstRow, LastRow, CurRow As Integer
Dim col As String
FirstRow = 5
LastRow = 20000
col = "AA"
For Each w In Worksheets
For CurRow = LastRow To FirstRow Step -1
If w.Cells(CurRow, col) = 0 Then
w.Rows(CurRow).Delete
Next CurRow
Exit For
Next
End Sub
Help!!!!