Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If you delete the row while you're traversing the rows, it becomes a pain.
But you could build a range to delete in the loop and then delete it later: dim c as range dim delRng as range For Each c In masterTrackerWs.Range("C2:C" & masterTrackerWs_lastRow).Cells If c.Offset(0, 1).Text = "#N/A" _ And c.Offset(0, 2).Text = "#N/A" Then if delrng is nothing then set delrng = c else set delrng = union(c, delrng) end if End If Next c if delrng is nothing then delrng.entirerow.delete end if Ayo wrote: If I wanted this for loop to start from the bottom row, how do I go about doing that. I want the row deletion to start from the last row going upwards. For Each c In masterTrackerWs.Range("C2:C" & masterTrackerWs_lastRow).Cells If c.Offset(0, 1).Text = "#N/A" And c.Offset(0, 2).Text = "#N/A" Then c.EntireRow.Delete End If Next c -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is it possible to reset the starting cell in a For Loop | Excel Discussion (Misc queries) | |||
vlookup : upwards | Excel Discussion (Misc queries) | |||
Searching UPWARDS for a value? | Excel Discussion (Misc queries) | |||
Autofill upwards!!!!! | Excel Discussion (Misc queries) | |||
loop question trying to bring excel into autocad text not starting in correct place | Excel Programming |