Share via

Make shape blink

Anonymous
2023-03-30T14:23:53+00:00

Hi, I have a sheet which holds a shape “Rounded Rectangle 4” which appears when another cell holds a specific text using the below code:

Private Sub Worksheet_Calculate()

 ActiveSheet.Shapes(“Rounded Rectangle 4”).Visible = UCase(Range(“I34”).Value) = “Pass”

End Sub

Could anyone please advise on the best way to now make this shape blink when it is showing?

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-03-31T14:38:29+00:00

    There is no built in function in excel for sharp blink.

    Here is an workaround. If you need more help on VBA code, you can create a new post in Stack Overflow. There are also many experienced engineers and experts in the forums there.

    ==========================

    Dim NextTime As Date

    Dim xColor As Long

    Sub Flash()

    NextTime = Now + TimeValue("00:00:01")

    With ActiveSheet.Shapes("Rounded Rectangle 4").Fill.ForeColor

    If xColor = 0 Then

    xColor = .SchemeColor

    End If

    .SchemeColor = Int(Rnd() * 55 + 1)

    End With

    Application.OnTime NextTime, "Flash"

    End Sub

    Sub StopIt()

    Application.OnTime NextTime, "Flash", schedule:=False

    ActiveSheet.Shapes("Rounded Rectangle 4").Fill.ForeColor.SchemeColor = xColor

    xColor = 0

    End Sub

    ==========================

    Best Regards,

    Snow Lu

    Was this answer helpful?

    0 comments No comments