Sound generating macro

S

Stefan

Can you tell me how I write a macro that generates a sound when for example a cell reaches a certain value or goes below a certain value?

I´m working online with live floating currencies and I want the computer to ,,let me know” when the exchange rates move ,,to much” in either direction. Can you help me solve this problem?

- Stefan
 
J

JE McGimpsey

Can you tell me how I write a macro that generates a sound when for example a
cell reaches a certain value or goes below a certain value?

I´m working online with live floating currencies and I want the computer to
,,let me know” when the exchange rates move ,,to much” in either direction.
Can you help me solve this problem?

One way:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Const cdTooLow As Double = 100#
Const cdTooHigh As Double = 200#
Const csErrScript = _
"say ""Too Much Movement!"" using ""Victoria"""

With Target
If .Address(False, False) = "A1" Then
If .Value <= cdTooLow Or .Value >= cdTooHigh Then _
MacScript (csErrScript)
End If
End With
End Sub

Change values and range to suit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top