Thread
:
for each c in range.. how set counter "minus 1"?
View Single Post
#
2
Posted to microsoft.public.excel.programming
Don Guillett
external usenet poster
Posts: 10,124
for each c in range.. how set counter "minus 1"?
You don't say what tel is but
the trick is to work from the bottom up and you really don't want to check
the WHOLE column.
for i=cells(rows.count,"F").end(xlup).row to 2 step-1
if cells(i,"f")=tel then rows(i).delete
next i
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"mino" wrote in message
...
Hi.
In my code, I delete the entire row of a particolar cell 'c' (if tel = c).
However, the loop "next c" jump to next one, but the real new 'c' is in
the same row, because actual 'c' in same row is deleted.
How can set c counter minus 1?
[...]
For Each c In Range("F:F")
If tel = c Then
Rows((c.Row)).Delete
End If
End If
Next c
[...]
Thanks to all
M.
Reply With Quote
Don Guillett
View Public Profile
Find all posts by Don Guillett