Is there a way to "pause" a macro to allow the user to delete rows from a table then allow the macro to continue. There need to be multiple pauses during the running of the macro. Any help is appreciated.
I do not know if you can stop a macro like that.
Why not have several separate macros
Run macro 1, end with message "Delete rows"
User deletes rows, and runs macro 2. Macro 2 ends with message "delete rows"
Well, one way is to write a macro for each segment and then use an ontime call to the next segment:
Code:
Application.Ontime Now + TimeValue("00:00:20"),"NextMacro"
the example gives the user 20 seconds to complete the action and then starts the macro you specify.
However, I wouldn't use this. Instead I'd show them a modeless userform with a description of the action they need to take and a 'continue' commandbutton, that will run the next part of your code.
i used the given example code above and it works fine, but i was wondering if there was a way to have the user enter a keystroke to get to the next macro instead of having it on time delay?
Heres my code:
...
Sub findA12()
Selection.Find.ClearFormatting
With Selection.Find
.Text = "A12"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Application.OnTime Now + TimeValue("00:00:05"), "findA27"
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.