Eloise T
Active Member
I found the code (see attachment) which changes the cell A1 font from red to green and back but is hanging on the last line:
Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
Any ideas what is wrong?
The entire subroutine:
Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
Any ideas what is wrong?
The entire subroutine:
Code:
Sub StartBlink()
Dim xCell As Range
Dim xTime As Variant
Set xCell = Range("A1")
With ThisWorkbook.Worksheets("Sheet1").Range("A1").Font
If xCell.Font.Color = vbRed Then
xCell.Font.Color = vbGreen
Else
xCell.Font.Color = vbRed
End If
End With
xTime = Now + TimeSerial(0, 0, 1)
Application.OnTime xTime, "'" & ThisWorkbook.Name & "'!StartBlink", , True
End Sub
Attachments
Last edited: