MrExcel Publishing
Your One Stop for Excel Tips & Solutions

how to make cells in excel 97 blink


Posted by kevin on July 10, 2001 2:42 PM

is there any way that you can make the contents of a particular cell blink or flash? Also, would there be a way to make the cell contents blink or not blink based on the contents?

thank you!
kevin


Posted by Joe Was on July 10, 2001 3:18 PM

Yes, You can loop the background color from white to color to white.
Or,
You can write the value or text to a variable, erase the cell then re-write the cell contents from the variable in a loop.

In both cases you will need to test for a cursor, active cell click or focus to break the timer loop in your flash code or the loop will run endlessly. Test it with a set number of flashes or build the break code first. JSW

Posted by GLITZ on July 10, 2001 5:37 PM

Do you do this loop in VB? Can you give me an example?

Thanks

Posted by Joe Was on July 11, 2001 8:20 AM

Loop VB code to Flash Cell Range.

The code can be chanhed to work on some condition. If you edit a cell in the range before the loop is finished, the cell color on exit will be set! The second macro will re-set the cell color if by chance this happens. The code below is commented to help costomize the options. JSW

Sub Flash()
'Make cell range flash x times, in x color, when Ctrl-a is pressed.
'
Dim newColor As Integer
Dim myCell As Range
Dim x As Integer

'Make this cell range flash!
Set myCell = Range("A1:A2")

'Make cell flash to this color!
newColor = 8

'Make cell flash, this many times!
Do Until x = 5

'Run loop!
DoEvents
Start = Timer
Delay = Start + 1
Do Until Timer > Delay
DoEvents
myCell.Interior.ColorIndex = newColor
Loop
Start = Timer
Delay = Start + 1
Do Until Timer > Delay
DoEvents
myCell.Interior.ColorIndex = xlNone
Loop
x = x + 1
Loop

End Sub


Sub reSetFlash()
'Re-set cell range color if edit break on color, Ctrl-r to re-set!
ActiveCell.Select
Selection.Interior.ColorIndex = xlNone
End Sub