Option Explicit
Public RunWhen As Double
Sub StartBlink()
If Range("A1").Interior.ColorIndex = 3 Then
Range("A1").Interior.ColorIndex = 6
Else
Range("A1").Interior.ColorIndex = 3
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
Sub StopBlink()
Range("A1").Interior.ColorIndex = xlAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub
Option Explicit
Public CellCheck As Boolean
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Range("A1") = "1" And CellCheck = False Then
Call StartBlink
CellCheck = True
ElseIf Range("A1") <> "1" And CellCheck = True Then
Call StopBlink
CellCheck = False
End If
End Sub
|