"for each element in group" question

C

Claude

Hi all

I want to use a "for each element in group" construct. How
can I go back one element during excecution,
e.g. if case1 then "go back one element".

Thanks for your help.
 
F

Frank Kabel

Hi
post your existing code. General idea:
store the last value in a tempory variable
 
C

Claude

Hi Frank

For Each cell In Intersect(ActiveSheet.UsedRange, Range
("B:B"))
If IsError(cell.Value) Then
Rows(cell.Row).Delete Shift:=xlUp
'go back one element, e.g. cell.index = cell.index-
1
End If
Next cell

I'll try to solve this in another way, just wonder whether
how one can do this in this type of setup
 
T

Tom Ogilvy

Not aware of anyway to do that using For Each.

Most use a For i = Lastrow to Firstrow Step -1

when deleting rows.
 
Top