Thread
:
General programming help
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
General programming help
the trick is to work from the bottom up
for i=cells(rows.count,"a").end(xlup).row to 2 step -1
if cells(i,"a") etc
next i
--
Don Guillett
SalesAid Software
"Erik" wrote in message
...
I'm trying to use the code below to delete rows from a sheet. The problem
is
that as it deletes a row, it then skips the next one. How can I create a
list of the rows to be deleted and delete them all at once after the For
loop?
Set ColA = Intersect(Sheet1.Columns("A"), Sheet1.UsedRange)
For Each cell In ColA
If cell.Value = Empty And Not cell.Offset(0, 1).Value = "Weekend
Diff"
Then
cell.EntireRow.Delete shift:=xlUp
End If
Next cell
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett