Excel - A macro to make cells blinks

December 2016



Issue


I want to make a cell blink under Excel. Can this be macro or a simpler way?

Solution


-1. Select the cell
-2. Choose Style from the Format menu.
-3. In the Style dialog box, enter a new style name, such as 'Blinking'.
-4. Using the controls in the dialog box, change the style attributes.
-5. Click on OK.

This style can be applied to the cells of your choice.
Now you need to create the macros:
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 blinking, just launch StartFlash
  • To stop it use StopFlash.


This tip is based on http://exceltips.vitalnews.com/Pages/T0214_Flashing_Cells.html

Thanks to Jeff for this tip.

Related :

This document entitled « Excel - A macro to make cells blinks » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.