leatherhen99
New Member
- Joined
- Dec 17, 2019
- Messages
- 27
- Office Version
- 365
- Platform
- Windows
Hi All! Happy Monday!
I have a unique situation that I can't seem to find a thread for (or a YouTube video
).
I have a macro that completes several pieces of coding... and based on what happens, the user might end up having to copy/paste information from another program into the Excel file for the final output to be complete...
I found that I can use the following code to create a 10-minute loop so that the user has time to copy and paste...
Is there a way that I can add to this code so that they can move forward in the macro if all 10 minutes aren't needed? The point of the macro is to save time...not to make them waste it if it's not necessary
Here's the macro that I call to within the larger macro:
Here's the portion of the code where I'm calling to 10 minutes to give the user time:
Thank you!
Heather
I have a unique situation that I can't seem to find a thread for (or a YouTube video

I have a macro that completes several pieces of coding... and based on what happens, the user might end up having to copy/paste information from another program into the Excel file for the final output to be complete...
I found that I can use the following code to create a 10-minute loop so that the user has time to copy and paste...
Is there a way that I can add to this code so that they can move forward in the macro if all 10 minutes aren't needed? The point of the macro is to save time...not to make them waste it if it's not necessary

Here's the macro that I call to within the larger macro:
VBA Code:
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
Thank you!
Heather