Forum Discussion
Using VBA to make a cell blink
- Dec 04, 2024
Just to show you how annoying it is, I have attached an example.
Also, keep in mind that blinking may be dangerous to users who are susceptible to epileptic seizures.
And it becomes annoying very quickly.
Finally: the existing conditional formatting overrules colors you set using VBA code.
Ok, I didn't realize that the conditional formatting would overrule that. I could have it change the fill color of column C instead since there is no conditional formatting there. Here is what I was working on for the VBA code, but I messed it up somewhere.
Sub BlinkCell()
Dim CellToBlink As Range
Set CellToBlink = Range("C8")
Do While Range("G8").Value >= 45
CellToBlink.Interior.ColorIndex = 3
Application.Wait (Now + TimeValue("0:00:01"))
CellToBlink.Interior.ColorIndex = 2
Application.Wait (Now + TimeValue("0:00:01"))
CellToBlink.Interior.ColorIndex = 3
Application.Wait (Now + TimeValue("0:00:01"))
DoEvents
If Range("G8").Value < 45 Then Exit Do
Loop
If Range("G8").Value < 45 Then
CellToBlink.Interior.ColorIndex = 2
End Sub
- HansVogelaarDec 04, 2024MVP
Just to show you how annoying it is, I have attached an example.
- lobo114Dec 04, 2024Brass Contributor
I suppose I could just set up conditional formatting to change column C to fill Red if column D has been a "No" for more than 45 days. The blinking does get annoying.
- lobo114Dec 04, 2024Brass Contributor
Ok, that is kind of annoying. I wonder if it would be less annoying if the font blinked instead of the fill color? What would need to be changed in the code?
- HansVogelaarDec 04, 2024MVP
Replace all instances of Interior in the Blink macro with Font