Help with blinking text

E

EW

I am current using the blink text code found at www.cpearson.com but I would
like to make it so that if I were to change a value in a cell that it would
then start blinking. So for example: If cell A1 changes to 80% or lower
then make A1 start blinking. Also, I would like to make the cell's fill
color blink from white to red and not the text (this is not as crititcal).
Any help on this would be great.

Thanks in advance!
 
G

Gary''s Student

First modify Pearson's code to blink interior rather than font:

Public RunWhen As Double
Sub StartBlink()
If Range("A1").Interior.ColorIndex = 3 Then
Range("A1").Interior.ColorIndex = xlColorIndexAutomatic
Else
Range("A1").Interior.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
Sub StopBlink()
Range("A1").Interior.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub


Then in worksheet code enter:

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A1")) Is Nothing Then Exit Sub
If Cells(1, 1).Value < 0.8 Then Call StartBlink
End Sub

REMEMBER worksheet code
 

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