Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Loop within a loop

Can I do a loop within a loop
I want to print scoresheets for squads

In cell "A1" I have the number of squads and in cell "A2" the number
of scoresheets for each squad.

In cell "U3" the macro must insert on the scoresheet a 1 for the squad
number and in "W3" a 1 for the round number
I then want to print 1 scoresheet, then increment "W3" by 1 for round
2, print another sheet and continue to do this until "W3" is equal to
the number of scoresheets in "A2"
It must then insert the next squad number in "U3" and run through the
same loop as above to print the right number of scoresheets for squad
2 and must continue to loop until the squad number ("U3") equals the
value in "A1"

Can you help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Loop within a loop

Simple enough


For i = 1 To Range("A2").Value

Range("U3").Value = Range("U3").Value + 1
For j = 1 To Range("A1").Value

Range("W3").Value = Range("W3").Value + 1

'rest of your code
Next j
Next i

--
__________________________________
HTH

Bob

"Brian" wrote in message
...
Can I do a loop within a loop
I want to print scoresheets for squads

In cell "A1" I have the number of squads and in cell "A2" the number
of scoresheets for each squad.

In cell "U3" the macro must insert on the scoresheet a 1 for the squad
number and in "W3" a 1 for the round number
I then want to print 1 scoresheet, then increment "W3" by 1 for round
2, print another sheet and continue to do this until "W3" is equal to
the number of scoresheets in "A2"
It must then insert the next squad number in "U3" and run through the
same loop as above to print the right number of scoresheets for squad
2 and must continue to loop until the squad number ("U3") equals the
value in "A1"

Can you help.



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
returning back to loop check condition without completing the loop ashish128 Excel Programming 13 April 3rd 08 12:53 PM
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM


All times are GMT +1. The time now is 03:56 PM.

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"