PDA

View Full Version : Solved: How do I run a macro a set number of times



markyc
05-10-2006, 06:39 AM
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

johnske
05-10-2006, 06:51 AM
Put the code into a loop e.g.
Option Explicit

Sub DoTenTimes()

Dim N As Long

For N = 1 To 10

'put all your code here

Next N

End Sub

markyc
05-10-2006, 07:18 AM
Thanks for your quick reply

This has worked

johnske
05-10-2006, 02:47 PM
Not a prob :)