G
Guest
Hi, Does anyone know if I can add a .wav file if a cell value is greater than
120? If so can you offer any advice?
120? If so can you offer any advice?
Dave Peterson said:Chip has two routines that produce the chimes sound.
The worksheet_calculate routine would be used if the cell to check contained a
formula.
If you are changing the value in that cell by typing, you could modify the
second routine so that it checks to see what was entered. (I still used 10 as
the cutoff.)
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
If Target.Value > 10 Then
sndPlaySound32 "chimes.wav", 0
End If
End If
End Sub
If the cell contains a formula, then I'd delete the worksheet_change event code.
If the cell changes because of typing, I'd delete the worksheet_calculate event
code.
If it could be either, then keep both.