Many Thanks
Solved Can I make excel play a sound
Share
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Ref Sound through excel
If On Database appears in Col X then it plays a sound
=COUNTIF($X$2:$X$2023,”On Database”)
Private Sub Worksheet_Change(ByVal Target As Range)
If Range(“X1”).Value = “1” Then
PlayWav
End If
End Sub
Private Declare Function PlaySound Lib “winmm.dll” _
Alias “PlaySoundA” (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Sub PlayWav()
Dim WAVFile As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
On Error GoTo ErrHandler
WAVFile = “C:BackupSound.wav”
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
Exit Sub
ErrHandler:
End Sub
message edited by emory