Flashing sentence makes sheet flash

N

nona

Thanks for the answers given to my first question! Now I've got tw
other questions and I hope somebody can help me with these matters.

The formula:

Dim NextTime As Date

Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then .ColorIndex = 3 Else .ColorIndex = 2
End With
Application.OnTime NextTime, "Flash"
End Sub

to let a sentence flash works, but the problem is that the entire shee
and other sheets flash a bit as well (not like the sentence but the
move as well) I've chosen the format flash for the sentences that nee
to flash and the rest of the sheets is formatted as normal so the
shouldn't flash but they do. How can I stop the rest of the sheets fro
flasing and how can I assure that the macro run
automaticly?:confused::confused:
Thanks in advance for the help!
 
D

Dave Peterson

I just tried this and I didn't see much flashing where it didn't belong.

You could try adding "application.screenupdating = false" to the top of the
module to try to suppress any flickering (I couldn't notice a difference with it
or without it, though).

And if you have all this stuff in a general module (and macros are enabled by
the user), it should start flashing when the workbook opens.

Option Explicit
Dim NextTime As Date
Sub auto_open()
Call Flash
End Sub
Sub Flash()
Application.ScreenUpdating = False
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then .ColorIndex = 3 Else .ColorIndex = 2
End With
Application.OnTime NextTime, "Flash"
Application.ScreenUpdating = True
End Sub
Sub auto_close()
Application.OnTime NextTime, "Flash", False
With ActiveWorkbook.Styles("Flash").Font
.ColorIndex = 3
End With
End Sub
 

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

Top