Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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!!!! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Syntax for stopping a Do Loop? | Excel Discussion (Misc queries) | |||
Naming Worksheets - Loop within a loop issue | Excel Programming | |||
VBA Loop Case..If syntax | Excel Programming | |||
loop syntax | Excel Programming | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming |