Good day everyone,
I got some code in the forum on how to make 'n cell blink and it works good however, I am trying to use the same code to make a shape blink. I was hoping someone could help me to just structure the code correctly. Below is the code for the blinking cell in Excel and below that is my very wrong and unstructured code. I was hoping someone could maybe look at this please.
Blinking Excel Cell code:
Dim NextTime As Date
Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then .ColorIndex = 3 Else .ColorIndex = 2
End With
Application.OnTime NextTime, "Flash"
End Sub
Sub StopIt()
Application.OnTime NextTime, "Flash", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
End Sub
The code for the Shape to blink:
Dim NextTime As Date
Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveSheet.Shapes("Flowchart: Decision 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1
End With
If .SchemeColor = 2 Then .SchemeColor = 3 Else .SchemeColor = 2
End With
Application.OnTime NextTime, "Flash"
End Sub
Sub StopIt()
Application.OnTime NextTime, "Flash", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
End Sub
Regards
"We know nothing but, that what we know is not the truth..." - Me
I got some code in the forum on how to make 'n cell blink and it works good however, I am trying to use the same code to make a shape blink. I was hoping someone could help me to just structure the code correctly. Below is the code for the blinking cell in Excel and below that is my very wrong and unstructured code. I was hoping someone could maybe look at this please.
Blinking Excel Cell code:
Dim NextTime As Date
Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveWorkbook.Styles("Flash").Font
If .ColorIndex = 2 Then .ColorIndex = 3 Else .ColorIndex = 2
End With
Application.OnTime NextTime, "Flash"
End Sub
Sub StopIt()
Application.OnTime NextTime, "Flash", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
End Sub
The code for the Shape to blink:
Dim NextTime As Date
Sub Flash()
NextTime = Now + TimeValue("00:00:01")
With ActiveSheet.Shapes("Flowchart: Decision 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 1
End With
If .SchemeColor = 2 Then .SchemeColor = 3 Else .SchemeColor = 2
End With
Application.OnTime NextTime, "Flash"
End Sub
Sub StopIt()
Application.OnTime NextTime, "Flash", schedule:=False
ActiveWorkbook.Styles("Flash").Font.ColorIndex = xlAutomatic
End Sub
Regards
"We know nothing but, that what we know is not the truth..." - Me