Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CelH As Range
Set CelH = CelluleImpactée(Dans:=[H:H], Par:=Target)
If CelH Is Nothing Then Exit Sub
Select Case CelH.Value
Case "Completed": PlayTheSound "chimes.wav"
Case "Not Completed": PlayTheSound "chord.wav"
Case "OUI": PlayTheSound "tada.wav"
End Select
End Sub
Private Function CelluleImpactée(ByVal Dans As Range, ByVal Par As Range) As Range
Dim Cel As Range, DirDep As Range
On Error Resume Next
Set DirDep = Par.DirectDependents: If Err Then Exit Function
On Error GoTo 0
For Each Cel In DirDep
Set CelluleImpactée = Intersect(Cel, Dans)
If CelluleImpactée Is Nothing Then Set CelluleImpactée = CelluleImpactée(Dans, Cel)
If Not CelluleImpactée Is Nothing Then Exit Function
Next Cel
End Function