Flashing Cells Or Text In Excel

Woody Pecker

New Member
Joined
Apr 11, 2008
Messages
35
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I want to make a cell or text within within a range flash based on whether it matches a the value of another cell.

Is there a set formula or VBA code that can help me do this?
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Excel does not have any built in feature to make text blink, and many people, including me, consider this a blessing. Most developers frown strongly at the notion of blinking text, arguing (with merit) that it is highly distracting. However, enough people have asked about it that it is worthy of discussion. Personally, I would not like a workbook with blinking text, but I don't share the passion of others in their dislike of the idea.
To make text blink,you need to execute a procedure periodically to change the font color of the text. The OnTime method can be used to run the procedure. You can use the code shown in the section below.

Complete VBA Code:

Code:
Public RunWhen As Double
 
Sub StartBlink()
With ThisWorkbook.Worksheets("Sheet1").Range("A1").Font
If .ColorIndex = 3 Then ' Red Text
.ColorIndex = 2 ' White Text
Else
.ColorIndex = 3 ' Red Text
End If
End With
RunWhen = Now + TimeSerial(0,0,1)
Application.OnTime RunWhen, "'" & ThisWorkbook.Name & "'!StartBlink", , True
End Sub 
 
Sub StopBlink()
ThisWorkbook.Worksheets("Sheet1").Range("A1").Font.ColorIndex = _ 
xlColorIndexAutomatic
Application.OnTime RunWhen, "'" & ThisWorkbook.Name & "'!StartBlink", , False
End Sub

Then, in the ThisWorkbook code module of the workbook, use code like:

Code:
Private Sub Workbook_Open()
StartBlink
End Sub
 
Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopBlink
End Sub
Summary




Two important points to keep in mind:
  • Since the OnTime schedules a procedure every second, you'll encounter sluggish editing.
  • Blinking text may not be allowed in applications for governmental bodies, since it may be in violation of Section 508 of the Rehabilitation Act Of 1973 (since blinking text can cause seizures in epileptic patients).
 
Last edited:
Upvote 0
Thanks

You right about the flashing, it's annoying beyond belief, but the boss wants it, what can you do.

Cheers


Nigel
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top