View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
John Coleman John Coleman is offline
external usenet poster
 
Posts: 274
Default set up a flashing background

Hi

Try something like this:

Sub FlashRed(R As Range, times As Long)
Dim i As Long
Dim start As Double
Dim flashRate As Double 'flashes per second
flashRate = 4
For i = 1 To times
R.Interior.ColorIndex = 3
start = Timer
Do While Timer < start + 1 / (2 * flashRate)
DoEvents
Loop
R.Interior.ColorIndex = xlAutomatic
start = Timer
Do While Timer < start + 1 / (2 * flashRate)
DoEvents
Loop
Next i
R.Interior.ColorIndex = 3
End Sub

Sub test()
FlashRed Range("H3"), 10
End Sub

Adjust flashRate to suit your taste (I guess I could have made it a
function parameter)

HTH

-John Coleman

Snake007 wrote:
I am trying to make the back ground of a cell flash. I am trying to do this
because I have entered error messages into a cell. I have the cell where it
turns red if there is an error but I would like it to flash to help gain the
attention of the person that has entered incorrect data causing the error.