Loading
Excel.Tips.Net ExcelTips (Menu Interface)

Flashing Cells

Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Flashing Cells.

Many people use the conditional formatting features of Excel to draw attention to specific values or areas of their worksheets. For instance, a cell might be formatted so that its contents are displayed in red or in boldface if above or below a certain threshold.

What is missing, however, is a way to make the contents of a cell flash, or blink on and off. For such a feat, you are left to your own devices and the miracle of macros. By utilizing these tools, you can make cells blink by first designing a special style for the blinking cells, and then running a simple macro.

To create the special style, follow these steps:

  1. Select the cell that you want to flash on and off.
  2. Choose Style from the Format menu. Excel displays the Style dialog box. (See Figure 1.)
  3. Figure 1. The Style dialog box.

  4. In the Style Name box, enter a new style name. (For this example, use the style name Flashing.)
  5. Using the controls in the dialog box, modify any attributes for the style, as you desire.
  6. Click on OK.

You can now apply the style to any other cells you desire in your workbook. Now create the macros (there are two of them), as follows:

Dim NextTime As Date

Sub StartFlash()
    NextTime = Now + TimeValue("00:00:01")
    With ActiveWorkbook.Styles("Flashing").Font
        If .ColorIndex = xlAutomatic Then .ColorIndex = 3
        .ColorIndex = 5 - .ColorIndex
    End With
    Application.OnTime NextTime, "StartFlash"
End Sub

Sub StopFlash()
    Application.OnTime NextTime, "StartFlash", schedule:=False
    ActiveWorkbook.Styles("Flashing").Font.ColorIndex = xlAutomatic
End Sub

To start the items flashing, simply run StartFlash. The cells formatted with the Flashing style will alternate between red and white text approximately once a second. When you want to turn the flashing off, simply run the StopFlash macro.

There is one important thing to note about this macro: the variable NextTime is declared outside of the actual procedure in which it is used. This is done so that NextTime maintains its value from one invocation of StartFlash to the next.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (2134) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Flashing Cells.

Related Tips:

A Picture is Worth Thousands! Your worksheets are not limited to holding numbers and text. You can also add graphics or easily create charts based on your data. Excel Graphics and Charts, available in two versions, helps you make your graphics and charts their absolute best. Check out Excel Graphics and Charts today!

 

Comments for this tip:

vinit kumar jha    15 Jul 2014, 08:29
Hi,

I am vinit and wanted to use Flash option in a cell...already created module as per above mentioned VB code...

but getting " Run time error 9)

Script out of range..

        .ColorIndex = 5 - .ColorIndex
John Morgan    17 Oct 2013, 11:20
I am trying to use the Flashing Cells Tip.
It is giving me a compilation error
"unable to set the ColorIndex property of the Font class".
The debugger highlights the code
".ColorIndex = 5 - .ColorIndex"

I am using 2002 Excel.
Can you help me please.

John.
Asif Kamal    17 Sep 2013, 06:34
Excellent one...great
Dave    05 Jul 2013, 07:57
Is it possible to make the cell flash if the date is reaching close to 30 days. I want to be notified that a client has not called within the 30 days period so that when it starts to flash I can call them.
Barry Fitzpatrick    01 Jun 2013, 06:21
It is some times easier for Users simply to have the macro toggle a cell value between TRUE and FALSE and use conditional formatting to flash whatever formatting the user desires without the need to delve into the macro itself and the to have knowledge of properties of the of cells and restrictions on the value they can be set to.

Leave your own comment:

*Name:
Email:
  Notify me about new comments ONLY FOR THIS TIP
Notify me about new comments ANYWHERE ON THIS SITE
Hide my email address
*Text:
*What is 3+4? (To prevent automated submissions and spam.)
 
          Commenting Terms
 
 

Our Company

Sharon Parq Associates, Inc.

About Tips.Net

Contact Us

 

Advertise with Us

Our Privacy Policy

Our Sites

Tips.Net

Beauty and Style

Cars

Cleaning

Cooking

DriveTips (Google Drive)

ExcelTips (Excel 97–2003)

ExcelTips (Excel 2007–2013)

Gardening

Health

Home Improvement

Money and Finances

Organizing

Pests and Bugs

Pets and Animals

WindowsTips (Microsoft Windows)

WordTips (Word 97–2003)

WordTips (Word 2007–2013)

Our Products

Premium Newsletters

Helpful E-books

Newsletter Archives

 

Excel Products

Word Products

Our Authors

Author Index

Write for Tips.Net

Copyright © 2014 Sharon Parq Associates, Inc.