Running a Macro a number of times

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
Jane from Portbury, nr Bristol (England) again
I have Office 2000 and XP
I don't know how to edit macros, VB language is a little too much for me -
but I can create them, use them and enjoy them.
I do lots of editing and often need to repeat keystrokes over and over
again, but once the file is finished never use the macro again so I tend to
save a macro to the keyboard, call it temp and run it using 2 keystrokes the
number of times I want the macro to run.
What I would like to be able to do is to run a macro say 5 times or 15 times
without hitting the 2 keystrokes the number of times required.
Hope this makes sense. I need this to work in Word as well.

Thanks
xJane
 
Sub hello()
MsgBox ("hello")
End Sub


Sub times_three()
For i = 1 To 3
Call hello
Next
End Sub

times_three calls hello three times
 

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

Back
Top