I want to play one of two wav files when cell D11 value changed from Right to Wrong. What I have works perfectly for the value "Right". But I don't know how to change the code to play a wav for "Wrong". I tried adding a second modual but that did not work.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("D11").Value = "Right" Then
Private Declare Function PlaySound Lib "winmm.dll" _
Alias "PlaySoundA" (ByVal lpszName As String, _
ByVal hModule As Long, ByVal dwFlags As Long) As Long
Dim WAVFile As String
Const SND_ASYNC = &H1
Const SND_FILENAME = &H20000
On Error GoTo ErrHandler
WAVFile = "C:UsersBillDesktopWhoopFlp.wav"
Call PlaySound(WAVFile, 0&, SND_ASYNC Or SND_FILENAME)
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!