Results 1 to 4 of 4

Flashing Cells Or Text In Excel

This is a discussion on Flashing Cells Or Text In Excel within the Excel Questions forums, part of the Question Forums category; I want to make a cell or text within within a range flash based on whether it matches a the ...

  1. #1
    New Member
    Join Date
    Apr 2008
    Posts
    6

    Default Flashing Cells Or Text In Excel

    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?

  2. #2
    Board Regular jeffreybrown's Avatar
    Join Date
    Jul 2004
    Location
    San Antonio, Texas
    Posts
    4,385

    Default Re: Flashing Cells Or Text In Excel

    You'll find most people on this site cringe at the thought of making a cell blink, but try a search on this site for flashing cells

    maybe...

    http://www.mrexcel.com/archive/VBA/5889.html

    Flashing Cell Color
    Last edited by jeffreybrown; Oct 14th, 2011 at 08:47 PM.
    Jeff

  3. #3
    New Member
    Join Date
    Apr 2011
    Location
    Kansas City, Mo
    Posts
    33

    Default Re: Flashing Cells Or Text In Excel

    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 by Xtrimmer; Oct 14th, 2011 at 08:52 PM.

  4. #4
    New Member
    Join Date
    Apr 2008
    Posts
    6

    Default Re: Flashing Cells Or Text In Excel

    Thanks

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

    Cheers


    Nigel

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


DMCA.com