Flashing Text in Excel 97


Posted by Chris Wood on January 16, 2000 8:20 PM

Just wondering if anyone out there knows of a method of making cell contents flash or blink on and off (similar to MS Word). I have seen reference to this on a VBA web site however it was some time ago and I can no longer locate the site!
Any suggestions would be greatly appreciated.
Regards
Chris



Posted by Ivan Moala on January 17, 2000 2:14 AM

Hi Chris
There are a number of ways to do this;
One way is as follows;

============================================
Sub FlashCell()

Dim x As Integer
Dim OrigColor As Integer
Dim NewColor As Integer
Dim CellToFlash As Range

OrigC = ActiveCell.Interior.ColorIndex
NewColor = 3
Set CellToFlash = Range("C46")

Do Until x = 20 'Flash 20 times
DoEvents
start = Timer 'Set timer
delay = start + 1 'Set delay
Do Until Timer > delay 'Dountil delay is exceeded = start+1
DoEvents
CellToFlash.Interior.ColorIndex = NewColor
Loop
start = Timer
delay = start + 1
Do Until Timer > delay
DoEvents
CellToFlash.Interior.ColorIndex = OrigColor
Loop
x = x + 1
Loop

End Sub

==================================
Experiment with different combinations eg
diff color Fonts etc, I usually flash an object
on/off via the objects visible property. Used in
combination with an objects increment you can
also animate the objects.

Ivan