Loop within a loop

  • Thread starter Thread starter Brian
  • Start date Start date
B

Brian

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.
 
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
 

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