How to Program Excel to Create a Warning Signal?
Probably yes. Suppose cell A2 has the stock's purchase price, cell B2
the highest price since purchase, cell C2 the current price, and cell
D2 the gain/loss since purchase. I assume C2 changes automatically
somehow, since you say it changes every couple of seconds, and D2
recalculates when C2 changes. Then you could use something like the
following in the code module for that worksheet.
Private Sub Worksheet_Calculate()
If Range("D2") = 25000 Then _
MsgBox "$25,000 gain", vbExclamation
If Range("C2") <= 0.6667 * Application.Max(Range("A2"), Range("B2"))
Then _
MsgBox "1/3rd loss", vbExclamation
End Sub
Hth,
Merjet
|