Nested For..Next Qn.

  • Thread starter Thread starter Stella
  • Start date Start date
S

Stella

Is it possible to force a change to a parameter in nested loops?

In other words, I want to compare two cells in different rows and, depending
on the result, restart the loop counter from a different position.

e.g.:-

For x = 1 to 99
For y = x+1 to 100
If Cells(x,1) = Cells(y,1) Then
Cells(y,1) = Range("y,3")
x = 1
next y
next x

The compare could be true at , say , x= 3 and y = 30 but I need the test to
recommence at x= 1 to take into account the new value in Cells(y,1)

I've tried the above plus a few variations but without success


TIA
Stella
 
apart from missing an END IF you have code that should work OK in terms
of resetting X
 

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