G
Guest
I would like to add an audio alert to a spreadsheet cell whenever it changes
to a specific value? Can this be done?
to a specific value? Can this be done?
Jason Morin said:Let's assume A1. Right-click the worksheet tab, select View Code, and place
in the following:
Sub Worksheet_Change(ByVal Target As Range)
Dim strSoundPath As String
Dim strSoundFile As String
'Change path and file name
strSoundPath = "C:\I386\"
strSoundFile = "Chimes.WAV"
'Change cell address if not A1
If Not Intersect(Target, Me.[A1]) Is Nothing Then
Call sndPlaySound32(strSoundPath & strSoundFile, 0)
End If
End Sub
---
Now place the following in a regular module:
'Play sound - www.cpearson.com
Public Declare Function sndPlaySound32 Lib "winmm.dll" Alias _
"sndPlaySoundA" (ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
---
HTH
Jason
Atlanta, GA
SellUnHi said:I would like to add an audio alert to a spreadsheet cell whenever it changes
to a specific value? Can this be done?