Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
If you want to repeat an entire macro a certain number of time, you
would need to call it that number of time. For example the following
code calls the macro named "CountDown" ten times:
Sub Test()
Dim i As Long
For i = 1 To 10
CountDown i
Next i
MsgBox "We have a liftoff."
End Sub
Sub CountDown(i As Long)
MsgBox "T-" & 11 - i & " seconds and counting."
End Sub
If your macro is performing a specific steps and you want to repeat
that step you would use a similiar construction to repeat the step:
Sub Test()
Dim i As Long
MsgBox "T-10 seconds. We have main motor start."
For i = 1 To 9
MsgBox "T-" & 10 - i
Next i
MsgBox "We have a liftoff."
End Sub
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.