#1   Report Post  
Posted to microsoft.public.word.pagelayout
CJ CJ is offline
external usenet poster
 
Posts: 36
Default Repeat a Macro

In Word 2003, I have set up a macro to find text in a table, split the
table above the found text, and then insert a page break. The table
is over 400 pages long (and the text I'm finding is on every page) and
I would like to be able to have the macro repeat as many times as the
text is found. Is this possible?
  #2   Report Post  
Posted to microsoft.public.word.pagelayout
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Repeat a Macro

Hi CJ,

This is easy to do by adding a loop to your code.

--
Cheers
macropod
[MVP - Microsoft Word]


"CJ" wrote in message ...
In Word 2003, I have set up a macro to find text in a table, split the
table above the found text, and then insert a page break. The table
is over 400 pages long (and the text I'm finding is on every page) and
I would like to be able to have the macro repeat as many times as the
text is found. Is this possible?

  #3   Report Post  
Posted to microsoft.public.word.pagelayout
Brian Brian is offline
external usenet poster
 
Posts: 298
Default Repeat a Macro

Not knowing your code I'll make assumptions.

After your "Selection.Find" line, add:

With Selection.Find
Do While Selection.Find.Execute
Your code........

Loop
End With
End Sub

Hope this helps,

--
Brian McCaffery


"CJ" wrote:

In Word 2003, I have set up a macro to find text in a table, split the
table above the found text, and then insert a page break. The table
is over 400 pages long (and the text I'm finding is on every page) and
I would like to be able to have the macro repeat as many times as the
text is found. Is this possible?

  #4   Report Post  
Posted to microsoft.public.word.pagelayout
CJ CJ is offline
external usenet poster
 
Posts: 36
Default Repeat a Macro

On Oct 23, 2:13*am, Brian wrote:
Not knowing your code I'll make assumptions.

After your "Selection.Find" line, add:

With Selection.Find
Do While Selection.Find.Execute
Your code........

Loop
End With
End Sub

Hope this helps,

--
Brian McCaffery



"CJ" wrote:
In Word 2003, I have set up a macro to find text in a table, split the
table above the found text, and then insert a page break. *The table
is over 400 pages long (and the text I'm finding is on every page) and
I would like to be able to have the macro repeat as many times as the
text is found. *Is this possible?- Hide quoted text -


- Show quoted text -


Didn't know about the loop. Thank you.
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
how do i get a macro to repeat itself Becka831 Microsoft Word Help 1 December 18th 06 09:39 PM
Simple Macro Repeat Marla 5670 Microsoft Word Help 6 October 18th 06 07:46 PM
how do I tell a macro how many times to repeat lee Microsoft Word Help 2 February 16th 06 09:02 PM
Repeat a macro? JLeck Microsoft Word Help 2 December 16th 05 06:59 PM
Repeat macro until end of document Chris@PDX Microsoft Word Help 1 July 7th 05 03:57 AM


All times are GMT +1. The time now is 12:30 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"