Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.newusers
|
|||
|
|||
Macro - Repeat Action
What is the command to repeat a macro in Word 2007? I want to run a macro on
a long list and want the macro to repeat 100+ times. |
#2
Posted to microsoft.public.word.newusers
|
|||
|
|||
Macro - Repeat Action
On Thu, 25 Dec 2008 13:01:51 -0800, "Jan Groshan" wrote:
What is the command to repeat a macro in Word 2007? I want to run a macro on a long list and want the macro to repeat 100+ times. There is no specific command for that. As an overly simplistic solution, you can write a second macro that calls the first one in a loop, like Sub Repeat100() Dim i As Long For i = 1 To 100 Call MyMacro Next i End Sub Change "MyMacro" to the name of the macro you want to repeat. The problem with this is that it always repeats 100 times. If that's too many or too few, it isn't easy to adjust. A better solution is to modify your original macro so the loop is inside it, and use a While loop or something of that sort (instead of the fixed For loop) to stop looping when all the work is done. Unfortunately, without knowing exactly what your macro does and how it does it, I can't be any more specific than that. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.newusers
|
|||
|
|||
Macro - Repeat Action
THANKS !
"Jay Freedman" wrote in message ... On Thu, 25 Dec 2008 13:01:51 -0800, "Jan Groshan" wrote: What is the command to repeat a macro in Word 2007? I want to run a macro on a long list and want the macro to repeat 100+ times. There is no specific command for that. As an overly simplistic solution, you can write a second macro that calls the first one in a loop, like Sub Repeat100() Dim i As Long For i = 1 To 100 Call MyMacro Next i End Sub Change "MyMacro" to the name of the macro you want to repeat. The problem with this is that it always repeats 100 times. If that's too many or too few, it isn't easy to adjust. A better solution is to modify your original macro so the loop is inside it, and use a While loop or something of that sort (instead of the fixed For loop) to stop looping when all the work is done. Unfortunately, without knowing exactly what your macro does and how it does it, I can't be any more specific than that. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Repeat same action | Tables | |||
F4 to repeat last action | Microsoft Word Help | |||
F4 or Ctrl-Y Repeat the Last Action | Microsoft Word Help | |||
I can't get the keyboard to repeat any action - help! | Microsoft Word Help | |||
F4 Repeat action in tables | Tables |