Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keystroke Instead of Time-Delay

Status
Not open for further replies.

noHandlebars

Technical User
Jun 25, 2008
46
US
The code below is currently on a time delay that will pause for 5 seconds and then go to the next designated macro:

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

'time delay command
Application.OnTime Now + TimeValue("00:00:05"), "findA27"


End Sub

Does anyone know if instead of having it on time delay, is it possible to have the user enter a keystroke that will have the code progress to the next macro?

 
How about just using a msgbox?

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
I forgot to mention during the "delay" the user needs to choose whether or not to delete rows from a table, and the time delay allows the user to manipulate the document but I don't think a message box allows the document to be manipulated.
 
No, it doesn't.

You can use a Form, though. Just make sure to set ShowModal to False. then have a 'continue' button that triggers the next macro.

[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 





Hi,

"Does anyone know if instead of having it on time delay, is it possible to have the user enter a keystroke that will have the code progress to the next macro?"

Run Procedure1 to completion, on some initial event.

User does stuff and Hits a Button.

Button click event runs Procedure2 to completion.

User does other stuff and hits another button.

Another button click event runs Procedure3 to completion.

And on and on until all the user interaction and proceured are done.

THAT how it's done.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top