Have the following macro below that I found on the interweb that I would like to refine. Basically looking for the macro to run automatically when the workbook is first launched. Also, if I have multiple values throughout multiple cells that I want the macro to work on, could that be accommodated somehow? For instance, if A1>4, but also if A5>25, etc? Thanks in advance mates.
Private Sub Flash_Cells()
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("A1")
For Each i In MakeFlash
If i.Value > 4 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 = 7
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 + 1
Loop
End If
Next i
End Sub
Bookmarks