Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub CleanUpChartLabels() Dim iPts As Integer Dim nPts As Integer Dim aVals As Variant Dim srs As Series Dim myChtObj As ChartObject If msgbox("Would you like to delete 0% datalabels? ... " & vbCrLf & _ "... i.e. all Data labels featuring just 0% of the total count of " & ActiveSheet.ChartObjects.Count & " Charts will be deleted?", vbQuestion + vbYesNo, "0% Datalabels") = vbNo Then Exit Sub End If For Each myChtObj In ActiveSheet.ChartObjects With myChtObj.Chart For Each srs In .SeriesCollection With srs If .HasDataLabels Then nPts = .Points.Count ' i = i + 1 aVals = .Values For iPts = 1 To nPts If aVals(iPts) = 0 Then .Points(iPts).HasDataLabel = False End If Next End If End With Next End With Next End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.