-
Solved: How do I run a macro a set number of times
I have two sheets
Sheet 1 has a list of risk numbers in column A, this list can be upto 2000 records long
Sheet 2 is a report that needs to contain the risk number at the top of the report.
I have created a macro that copies first risk number, pastes into top of report, prints report, goes back to sheet 1 and selects next risk number.
I want to be able to tell macro only to do this loop 10 times, to ease data sent to network printer
Please can you advise
-
Put the code into a loop e.g.
[VBA]Option Explicit
Sub DoTenTimes()
Dim N As Long
For N = 1 To 10
'put all your code here
Next N
End Sub[/VBA]
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
-
Thanks for your quick reply
This has worked
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules