Audible beep from cell value

Stevie p

Board Regular
Joined
Mar 8, 2009
Messages
228
Hi,
Is it possible that when a workbook opens and worksheet "Main" cell ("G2") value is greater than zero that you could have an aubible warning Beep for example......? Regards Stevie p.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
In VBA module:
Code:
Private Declare Function PlaySound Lib "winmm.dll" _ 
Alias "PlaySoundA" (ByVal lpszName As String, _ 
ByVal hModule As Long, ByVal dwFlags As Long) As Long 

Const SND_SYNC = &H0 
Const SND_ASYNC = &H1 
Const SND_FILENAME = &H20000 

Public Function Allarm() 
WAVFile = "c:\windows\media\tada.wav" 
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME) 
End Function
In one cell:
Code:
=IF([I]G2>0,[/I]Allarm(),"")
 
Last edited:
Upvote 0
Another approach:-
Code:
Private Sub Workbook_Open()
  If Sheets("Main").Range("G2") > 0 Then Beep
End Sub
Considerations: will the sound on the PC be enabled & turned up, will the beep be audible at all, and will people know what the beep signifies?
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,844
Members
452,948
Latest member
UsmanAli786

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