View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
IanKR IanKR is offline
external usenet poster
 
Posts: 97
Default Go straight to next value in a For... Next loop

Is there a way of going straight to the next value in a For / Next loop,
having tested the current value? I need to do something like this (for
example):

Dim c as Range
For each c in Selection.Cells
If c.Value < 100 Then
Goto Next c '<<<<< I know this is illegal, but it illustrates
what I want to do!
Else
{statements where c.Value = 100}
...
...
End If
Next c

I don't want to Exit For, I just want it to effectively ignore the current
instance of c and move onto the next. I've tried "Next c" but it generates a
compile error.

Thanks in advance.

Ian