flashing cell in excel

E

EXCEL USER

Hi, I have the cell flashing but it is only visible when i drag the cells and
when the cells are covered with mouse draged cell shadow. Here are my
codings on macro please help to make it visible.

also when I password my sheet to be protected the effect of macro to flash
is shuts off. I have unlocked whole column and also deselected from range
that is being selected for protection

Public RunWhen As Double

Sub StartBlink()
If Range("bq6:bq89").Font.ColorIndex = 2 Then
Range("bq6:bq89").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("bq6:bq89").Font.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub

also here is my coding for stop blinking
Sub StopBlink()
Range("bq6:bq89").Font.ColorIndex = xlColorIndexAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub

please help me this is an urgent need thank you, you can e-mail me at
(e-mail address removed)

NK
 
T

Tom Ogilvy

looks like a logic error here:

Sub StartBlink()
If Range("bq6:bq89").Font.ColorIndex = 2 Then
Range("bq6:bq89").Font.ColorIndex = xlColorIndexAutomatic
Else
Range("bq6:bq89").Font.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub

You set the color index to 3, then to change it back you don't do anything
unless it is set to 2. Doesn't make any sense. If you change it to 3, then
your if statement should check if it is 3.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

URGENT HELP ON BLINKING/FLASHING CELL 5
Run Error while protected 1
Blinking cells 6
Protection in VBA. 2
Flashing Cell for a number range 8
VBA code does not work 7
Code Error 3
Run - time error '1004' 1

Top