Tom’s Tutorials For Excel: Getting Attention With Multiple Beeps
Let’s face it, sometimes a warning needs a little more emphasis than the usual single Beep. There are some sound wave files already built into your computer that can be called on, but for today, here’s a simple method for sounding several Beeps instead of just the usual single Beep.
In a new fresh standard module, paste this in for a rapid-fire 5-Beep experience. You can adjust the time interval between Beeps by adjusting the
Sleep factor. For example, reducing the number 175 to, say, 100 will sound the Beeps in faster rapid-fire. Increasing the
Sleep factor will space out the Beeps over a longer period of time.
Private Declare Sub Sleep Lib "kernel32" (ByVal dxMilliseconds As Long) Sub BEEP5() Dim myCount% myCount = 0 Do Until myCount = 5 Beep myCount = myCount + 1 Sleep 175 Loop End Sub
Hello, I tried the beep program but I am unable to hear anything., I can hear *.wav files but not the beep. What am I missing? Thanks.
Hmmm…can’t say that you are missing anything. I tried it many times and it worked for me no problem. I don’t know what you mean by hearing wav files; maybe you mean other wav files generally, havingnothing to do with this macro?
I’m not trying to sound funny here, so apologies in advance, but just in case, make sure your audio system is not on Mute and your speakers are on. Post back with whatever happens after you test it again.
Try this also: Open Excel, and from your keyboard, press Alt+F11. careful, that’s ALT + F11.
Then hit Ctrl+G.
Type in the word Beep and hit Enter
You should hear a beep. If you don’t, something is going on with your system or with Excel.
Any idea as to how to modify this routine to work on a Macintosh running Excel 2016?
This isn’t a part of the Mac world: Private Declare Sub Sleep Lib “kernel32” (ByVal dxMilliseconds As Long)
Macs don’t support API calls and some Macs don’t support VBA. I’m a PC guy who does empathize with your situation, but Macs have their programmable limitations and this is one of them. If I come across anything I’ll post it here.