FUCNTION THAT SOUND AUDIO ALARM WHEN SPECIFIC VALUE FOUND

  • Thread starter Thread starter Roger Excellent
  • Start date Start date
R

Roger Excellent

I need my PC to give an audio sound when a specific value in a nominated cell
is attained. For example if cell A1 = or greater than 2000 an ausio sound
will occur.
 
The value comes from data entry, but data entry is not keyed in through the
keyboard it comes from a feed external to Excel (i.e. another program
collects data from a TCP port via a broadband connection).
 
Let's link some other cell to A1 to cuase a calculation to occur whenever A1
is updated. So in some un-used cell, enter:

=A1

Then install this event macro in the worksheet code area:

Private Sub Worksheet_Calculate()
If Range("A1").Value > 1999 Then
msg = "Danger Will Robinson Danger"
Application.Speech.Speak msg
End If
End Sub

Because it is worksheet code, it is very easy to install and use:

1. right-click the tab name near the bottom of the window
2. select View Code - this brings up a VBE window
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE windows as above
2. clear the code out
3. close the VBE window

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

To learn more about Event Macros (worksheet code), see:

http://www.mvps.org/dmcritchie/excel/event.htm
 
Use a conditional and a call to a hyperlink as the true result. The
hyperlink has the multimedia desired,Size the window to hide it or
explicitly size it like a dreaded pop-up put an image in there too!
 
Back
Top