learherhen99 posted the following on March 2,2020 and stated that this worked. I cannot get it to pause a macro. I had a problem with the If Then statements with no End If so I added, The routine would not end and return to the calling routine. Does anybody have any ideas I might try? Thanks in advance.
Sub WasteTime(Finish As Long)
Dim NowTick As Long
Dim EndTick As Long
EndTick = GetTickCount + (Finish * 1000)
Do
NowTick = GetTickCount
DoEvents
Loop Until NowTick >= EndTick
End Sub
Here's the portion of the code where I'm calling to 10 minutes to give the user time:
VBA Code:
'Ask user if NoActivity/Future dates need to be added
Dim Answer As VbMsgBoxResult
Answer = MsgBox("Past, present and/or future dates highlighted will *not* be available on the Timesheet Tab." & _
" Do you need to add 'No Activity' or future dates to the FutureWorking tab?", vbYesNo + vbQuestion + vbDefaultButton2, "No Activity Dates")
'If past/future dates need to be manually copied/pasted, give user 10 minutes
If Answer = vbNo Then
'if no additional updates, move to Timesheetv8 macro
Call Timesheetv8
'if yes, wait for 10 minutes while the information is inputted...
If Answer = vbYes Then
WasteTime (600)
End Sub
Sub WasteTime(Finish As Long)
Dim NowTick As Long
Dim EndTick As Long
EndTick = GetTickCount + (Finish * 1000)
Do
NowTick = GetTickCount
DoEvents
Loop Until NowTick >= EndTick
End Sub
Here's the portion of the code where I'm calling to 10 minutes to give the user time:
VBA Code:
'Ask user if NoActivity/Future dates need to be added
Dim Answer As VbMsgBoxResult
Answer = MsgBox("Past, present and/or future dates highlighted will *not* be available on the Timesheet Tab." & _
" Do you need to add 'No Activity' or future dates to the FutureWorking tab?", vbYesNo + vbQuestion + vbDefaultButton2, "No Activity Dates")
'If past/future dates need to be manually copied/pasted, give user 10 minutes
If Answer = vbNo Then
'if no additional updates, move to Timesheetv8 macro
Call Timesheetv8
'if yes, wait for 10 minutes while the information is inputted...
If Answer = vbYes Then
WasteTime (600)
End Sub