VinceF
Board Regular
- Joined
- Sep 22, 2007
- Messages
- 206
- Office Version
- 2016
- Platform
- Windows
Greeting,
Is there a way to modify the below code so that when the workbook is opened cell O2 will automatically start blinking without having to select the cell.
The top code is in "Main" sheet and the bottom code is in a Module?
Thanks
VinceF
Win10
Office2019
Is there a way to modify the below code so that when the workbook is opened cell O2 will automatically start blinking without having to select the cell.
The top code is in "Main" sheet and the bottom code is in a Module?
Thanks
VinceF
Win10
Office2019
VBA Code:
Option Explicit
Public CellCheck As Boolean
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Range("O2") = "Select Game" And CellCheck = False Then
Call StartBlink
ElseIf Range("O2") <> "Select Game" And CellCheck = True Then
Call StopBlink
CellCheck = False
End If
End Sub
VBA Code:
Option Explicit
Public RunWhen As Double
Sub StartBlink()
If Range("O2").Interior.ColorIndex = 49 Then
Range("O2").Interior.ColorIndex = 6
Else
Range("O2").Interior.ColorIndex = 49
End If
RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime RunWhen, "StartBlink", , True
End Sub
Sub StopBlink()
Range("O2").Interior.ColorIndex = xlAutomatic
Application.OnTime RunWhen, "StartBlink", , False
End Sub