Simply was to repeat a macro N times

J

Joe Wooldridge

Is there is sample way to execute a macro N number of
times without hitting a control key repeatitively?

Thanks
 
P

Paul B

Joe, is this what you have in mind?
Sub test_loop()
Dim i As Integer
i = 1
Do Until i = 12
'put code here if A1 has 1 then this will run till A1 = 12
Sheet1.[A1] = Sheet1.[A1].Value + 1
i = i + 1
Loop
End Sub


--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
M

Myrna Larson

Write a "helper" procedure:

Sub RepeatMacro()
For i = 1 to 10
TheRealMacro
Next i
End Sub
 

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

Top