Animated Speedometer
Charts and Visualization

Animated Speedometer Chart in Excel

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-

Animated Speedometer Chart
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

Click here to download the Practice file-

Watch the step by step video tutorial:

PK
My Name is PK. I am founder of PK-AnExcelExpert.com. I am a Microsoft Certified Professional. I have more than 10 years of experience in Data Visualization, Excel Automation and dashboard creation. Excel is my passion and I like to do always something innovative in Excel and share it with other people.
https://www.pk-anexcelexpert.com