Home>Blogs>Charts and Visualization>Animated Speedometer Chart in Excel
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
Meet PK, the founder of PK-AnExcelExpert.com! With over 15 years of experience in Data Visualization, Excel Automation, and dashboard creation. PK is a Microsoft Certified Professional who has a passion for all things in Excel. PK loves to explore new and innovative ways to use Excel and is always eager to share his knowledge with others. With an eye for detail and a commitment to excellence, PK has become a go-to expert in the world of Excel. Whether you're looking to create stunning visualizations or streamline your workflow with automation, PK has the skills and expertise to help you succeed. Join the many satisfied clients who have benefited from PK's services and see how he can take your Excel skills to the next level!
https://www.pk-anexcelexpert.com