ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Blinking Cell (Worksheet restarts) (https://www.excelbanter.com/excel-programming/332932-blinking-cell-worksheet-restarts.html)

FloggingDolphin

Blinking Cell (Worksheet restarts)
 

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

--
FloggingDolphinPosted from http://www.pcreview.co.uk/ newsgroup acces



All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com