This has become a popular page in Google and my original notes on how to make a beep in VBA code did not work for everyone, so I have added some extra tips.
The basic code is:
Yes, it can be really that easy, but it does not work for everyone. If it does not work the first place to check is that the system has a sound associated with the default, this is done by:
Control Panel -> Hardware and Sound -> Change system sounds
(or just open the control panel window and search for change system sounds)
You need to have a speaker symbol next to Default Beep, as shown in the screen shot below. if you don’t, click on Default Beep and then select a sound from the drop down box below.
If that still does not work you may have the system sounds turned off and sometimes you can get around this by enabling the system sound, as follows:
Application.EnableSound = True
Application.EnableSound = False
If you want to play different types of beep depending on the condition have a look at the following
You can also play WAV files within a VBA macro but that looked a little more complex. Search on “Excel VBA play wav file” and you will find several examples.