In this article, we have created an Animated Speedometer Chart using Excel Charts and VBA. This beautiful chart can be used in your business dashboard. An animation will run when the value of service level will be changed, or worksheet will be activated.
Below is the snapshot for Animated Speedometer Chart-

Below is the code to run this animation-
Option Explicit Private Sub Worksheet_Activate() If IsNumeric(Range("C1").Value) = False Then MsgBox "Incorrect Value" Exit Sub End If If Range("C1").Value > 1 Or Range("C1").Value < 0 Then MsgBox "Incorrect Value" Exit Sub End If Dim i As Integer For i = 1 To Int(Range("I1").Value * 100) VBA.DoEvents Range("L1").Value = i / 100 Next i Range("L1").Value = Range("I1").Value End Sub
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$I$1" Then If IsNumeric(Target.Value) = False Then MsgBox "Incorrect Value" Exit Sub End If If Target.Value > 1 Or Target.Value < 0 Then MsgBox "Incorrect Value" Exit Sub End If Dim i As Integer For i = 1 To Int(Target.Value * 100) VBA.DoEvents Range("L1").Value = i / 100 Next i Range("L1").Value = Target.Value End If End Sub