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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building in a delay between Beeps in Excel VBA

Status
Not open for further replies.

markgo

Technical User
Joined
Oct 10, 2002
Messages
3
Location
GB
I am trying to build 2 second delays between Beeps in Microsoft Excel VBA. Can anybody help with the code required please
 
Try inserting this:

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 2
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
*Remember.......
If you don't use your head,
your going to have to use your feet.
 
Perfect, thanks very much. Inserted tested and works fine. What a great site. Hope I can return the favour some time.
 
Another way, create a new sub using this code:


Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)


Call it using this and the amount of time in brackets:


Call Sleep(5000)
 
Dear BIGALINWALES

Many thanks for this piece of code. I will try it tomorrow. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top