Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.newusers
Jan Groshan Jan Groshan is offline
external usenet poster
 
Posts: 55
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.newusers
Jan Groshan Jan Groshan is offline
external usenet poster
 
Posts: 55
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Repeat same action clara Tables 2 April 13th 07 01:26 PM
F4 to repeat last action Idaho Word Man Microsoft Word Help 5 March 1st 07 03:51 PM
F4 or Ctrl-Y Repeat the Last Action MarieJ Microsoft Word Help 2 November 3rd 05 03:13 AM
I can't get the keyboard to repeat any action - help! JG Microsoft Word Help 1 August 29th 05 11:48 PM
F4 Repeat action in tables Barbara from the home of Nessie Tables 2 August 8th 05 04:49 PM


All times are GMT +1. The time now is 12:01 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"