Blinking Cell (Worksheet restarts)

F

FloggingDolphin

Hi there,

I've copied and pasted some VBA code (can't remember which free site
got it from now) which gives me a blinking cell. However, each time
close the worksheet it re-opens itself.i've tried to add something t
prevent it from doing that but i just get an error when i quit th
worksheet. I can only stop it from re-opening if I disable th
macros.

Could someone please assist, I'd gladly appreciate! The VBA code is:
-------------(for this workbook)-----------


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.OnTime BlinkTime, "Blink", , False

End Sub

Private Sub Workbook_Open()

Call Blink

End Sub





-------------(in a module)----------------

Dim BlinkTime As Date

Public Sub Blink()
Dim c As Range

For Each c In Range("C3").Cells
If c.Interior.ColorIndex = 47 Then
If c.Value > 100 Then
c.Interior.ColorIndex = 2 'White
ElseIf c.Value > 50 Then
c.Interior.ColorIndex = 2 'White
Else
c.Interior.ColorIndex = 2 'White
End If
Else
c.Interior.ColorIndex = 47
End If
Next c


BlinkTime = Now() + TimeValue("00:00:01")
Application.OnTime BlinkTime, "Blink"
End Su
 

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