Pausing VBA issue

andrewb90

Well-known Member
Joined
Dec 16, 2009
Messages
1,077
Hello all,

I've tried a few varieties of this and each time VBA seems to be running much longer than necessary for a "1 second" pause. Can anybody help me out with what's wrong?

Code:
Private Sub KeepOpenWB_Click()
Sheets("HOME").Range("AM1").Value = 1
Me.Hide
MultiFileOK.Show
If Application.Wait(Now + TimeValue("0:00:01")) Then
MsgBox "times up"
'Application.WaitNow TimeValue("00:00:01")
'Application.Wait (Now + #12:00:01 AM#)
MultiFileOK.Hide
End If
End Sub
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Ok, I realized what my problem has been this entire time. Since I had a userform up, excel was waiting until I closed it, So now I just need to see if there is a way for excel to keep running with a userform or msgbox up...
 
Upvote 0

Forum statistics

Threads
1,216,099
Messages
6,128,820
Members
449,469
Latest member
Kingwi11y

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top