Excel make cell flash red [Solved/Closed]

Report
Posts
4
Registration date
Thursday February 5, 2009
Status
Member
Last seen
February 23, 2009
-
 Rjc -
Hello,
In Excel I can make cell red when formula is greater than 4 but how do I GET CELL TO FLASH Office 2003

And can you in same spreadsheet link page with name under dates to sheet containing name in row to a number under same date IE j bloggs under 30 Mar in weekly sheet to a 1 under same date in monthy sheet every time name appears ( 160 name to go in)

2 replies

Private Sub Flash_Cells()

Dim FlashColor As Integer
Dim MakeFlash As Range
Dim x As Integer
Dim TheSpeed
Dim i

'Just a random range of cells. Change it to whatever you want.
Set MakeFlash = Range("A1,C6,F3,H4")

For Each I In MakeFlash

If i.Value > 4 Then

FlashColor = 3 'Set the color to red

'Make the cell range flash fast: 0.01 to slow: 0.99
TheSpeed = 0.2

'Flash 7 times
Do Until x = 7

DoEvents
Start = Timer
Delay = Start + TheSpeed
Do Until Timer > Delay
DoEvents
MakeFlash.Interior.ColorIndex = FlashColor
Loop
Start = Timer
Delay = Start + TheSpeed
Do Until Timer > Delay
DoEvents
MakeFlash.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop

End If
Next i

End Sub
63
Thank you

Glad we were able to help! Love us? Write us a review! Rate CCM

CCM 3881 users have said thank you to us this month

I used you macro to make cells flash and It works great.I have 7 cells listed c3,d3,e3,f3,g3,h3,i3 They all flash can you tell how to make thecell that has high number only flash. Thanks
Would you please tell me exactly where to insert this code? i.e. under "new module", or "alt-F11" in that window? (I'm a less than a novice)
rizvisa1
Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
756
depends on how you plan to use it.
I used in module, then "run" it.
To check the result, use side by side windows.
Excellent code works 100% thanks.
Drop this code all under "ThisWorkbook" in VBAProject window. Change anything in bold to fit your spreadsheet. This will actually flash yellow - change 6's to 3's if you want Red

Private NextFlash As Double
Private Const FR As String = "'[Name Of Your Workbook.xls]Name Of Your Sheet'!A3"
Sub StartFlashing()
If Range(FR).Interior.ColorIndex = 6 Then
Range(FR).Interior.ColorIndex = xlColorIndexNone
Else
Range(FR).Interior.ColorIndex = 6
End If
NextFlash = Now + TimeSerial(0, 0, 1)
Application.OnTime NextFlash, "ThisWorkbook.StartFlashing", , True
End Sub
Sub StopFlashing()
Range(FR).Interior.ColorIndex = xlColorIndexNone
Application.OnTime NextFlash, "ThisWorkbook.StartFlashing", , False
End Sub
Private Sub Workbook_Open()
ThisWorkbook.StartFlashing
End Sub
Private Sub Workbook_Close()
ThisWorkbook.StopFlashing
End Sub
Thank you dave, it works, it really works.
This has been really useful, thank you.

Does anyone have any simple way of making the flashing stop dependent on criteria. For example, how about if FR does not have pin in it?

I have tried to add in this:

If Range(FR).Value <> "pin" Then

but no luck so far. Any help greatly appreciated

Jo
rizvisa1
Posts
4475
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
January 6, 2016
756 > Jo
If you are talking about Dave code then make this change


change
If Range(FR).Interior.ColorIndex = 6 Then


to

    If Range(FR).Value <> "pin" Then
        Range(FR).Interior.ColorIndex = xlColorIndexNone
    
    ElseIf Range(FR).Interior.ColorIndex = 6 Then


This will flash if word pin is in FR, else it will not flash. Though from your comments I think you want to say that if pin is there dont flash else flash in that case change <> to =
salserajo
Posts
2
Registration date
Friday March 5, 2010
Status
Member
Last seen
March 5, 2010

Hi,

Thanks this has been really useful.

I was wondering if you can change this to make it so that the flashing stops when text is entered into the cell?

I have tried this:

If Range(FR).Value <> "Pin" Then
StopFlashing
End if

but can get it to work.

I want to be able to attract peoples attention to the flashing cell to add a pin. When they have entered one I want it to stop flashing. It will originally have PIN entry in the cell

Any help appreciated, only want a simple as possible a solution

Thanks

Jo
Hi, is there a way to make the routine run once if a certain criteria is met? I used the code and pasted into the VB module for the worksheet Im playing with and set the parameters so that Cell B1 would Blink if cell A1 was False, then used a basic T/F IF statement on B1 =IF(A1=1, FALSE,TRUE), problem is I have to hit the run script button in the VB editor to get it to blink..