Chavito1983
Technical User
Hi all,
I'm a vb amateur so please bear with me
...
Who can help me find a way to loop something until the end of a Word document? I just can't get it to stop.
Primarily, I am trying to loop (or better, alternate) two macros from the insertion point until the end of the document. If possible and easy to do, I would like to also have the option to select some text and run the macros on the selected text instead of the remainder of the document.
The following works. The problem is that there is no way of telling how many times the macros are going to run before the end, so counters are not an option. Each macro grabs a portion of text based on its contents and processes it. The insertion point then moves past the processed section.
Thanks a lot for any help!
Chavo
I'm a vb amateur so please bear with me
Who can help me find a way to loop something until the end of a Word document? I just can't get it to stop.
Primarily, I am trying to loop (or better, alternate) two macros from the insertion point until the end of the document. If possible and easy to do, I would like to also have the option to select some text and run the macros on the selected text instead of the remainder of the document.
The following works. The problem is that there is no way of telling how many times the macros are going to run before the end, so counters are not an option. Each macro grabs a portion of text based on its contents and processes it. The insertion point then moves past the processed section.
Code:
Sub GetFuzzies()
Do
Application.Run MacroName:="macro1"
Application.Run MacroName:="macro2"
Loop
End Sub
Thanks a lot for any help!
Chavo