Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Apr 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Flashing Cells (VB/Excel)

    I found a previous board that had the following:

    To make a cell flash every second if it's value is 1, you could use conditional formatting in the target cell, with the formula:
    =AND(MOD(VALUE(TEXT(NOW(),"ss")),2)=0,A1=1)
    and set the conditional format to whatever font/background/border arrangement you want. Then add the following macro to the workbook:
    Sub FlashCell()
    Range("A1").Calculate
    Application.OnTime Now + TimeValue("0:00:01"), "FlashCell"
    End sub

    My question is what do I need to change if I just want a cell to Flash if the calculated total is a negative number?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Flashing Cells (VB/Excel)

    I seriously recommend NOT using flashing cells. The novelty of such an approach quickly wears off, and it then becomes irritating to the user. Moreover, it can be dangerous to people susceptible to epileptic seizures.

    You can draw attention to a cell using conditional formatting: give the cell a thick red border if its value is negative, or something like that.

  3. #3
    2 Star Lounger
    Join Date
    Apr 2004
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Flashing Cells (VB/Excel)

    EXCELLENT POINT.... One My teacher stated last semester. I forgot about that. Thanks for the save. So how can I make the border do what I need it to do. What about background color too?

  4. #4
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Flashing Cells (VB/Excel)

    Select the cells where this is to apply. Then go to Format/Conditional Formatting. Change the drop down list to "Formula is". In the formula box enter:

    <code>
    =A1<0
    </code>

    In the above formula above, change A1 to whatever cell address is the current cell in the cells you selected.

    Click on the Format button and select whatever formatting you want.
    Legare Coleman

Posting Permissions

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