Getting a Cell to Flash When it's Below a Value [Closed]

Report
-
Hi I am trying to make cell B3 flash when the value in it drops below 500 and stop when it goes above it.

I have this macro running but it does not stop:


Sub Flash()
Dim FlashColor As Integer
Dim MakeFlash As Range
Dim x As Integer
Dim TheSpeed
Dim i

'Just a random range of cells. Change it to whatever you want.
Set MakeFlash = Range("B3")

For Each i In MakeFlash

If i.Value < 500 Then

FlashColor = 3 'Set the color to red

'Make the cell range flash fast: 0.01 to slow: 0.99
TheSpeed = 0.2

'Flash 7 times
Do Until x = 100

DoEvents
Start = Timer
Delay = Start + TheSpeed
Do Until Timer > Delay
DoEvents
MakeFlash.Interior.ColorIndex = FlashColor
Loop
Start = Timer
Delay = Start + TheSpeed
Do Until Timer > Delay
DoEvents
MakeFlash.Interior.ColorIndex = xlNone
Loop
x = x + 6
Loop


End If
Next i

End Sub


Any suggestions?

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!