Macro: Ask user how many times to repeat

A

AryehS

How do I get a window or dialog box to ask the user how many times to repeat
a macro?

Thanks in advance
Aryeh
 
G

Greg Maxey

Something like:

Sub Macro1()
Dim i As Long
For i = 1 To InputBox("How many times to you want to run Macor2?", "Run", 1)
Macro2
Next i
End Sub

Sub Macro2()

Selection.TypeText Text:="Now is the time for all good men ..."
Selection.TypeParagraph
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