Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Nested For..Next Qn.

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Nested For..Next Qn.

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

Stella wrote:
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
nested ifs dave glynn Excel Discussion (Misc queries) 4 November 13th 09 07:55 PM
Nested IF EZ[_2_] Excel Worksheet Functions 5 June 16th 09 10:03 PM
nested If Dave Shultz Excel Discussion (Misc queries) 3 March 3rd 09 05:52 PM
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
What is quicker? Nested or non nested ifs andycharger[_17_] Excel Programming 2 February 25th 04 03:58 PM


All times are GMT +1. The time now is 05:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"