"for each element in group" question

  • Thread starter Thread starter Claude
  • Start date Start date
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.
 
Hi
post your existing code. General idea:
store the last value in a tempory variable
 
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
 
Not aware of anyway to do that using For Each.

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

when deleting rows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top