TheTiredEngineer
New Member
- Joined
- Jul 31, 2024
- Messages
- 31
- Office Version
- 365
- Platform
- Windows
Im trying to format my data labels in a neat way to keep the chart from being so cluttered. I want to have some of the labels to the left of the actual chart and some on the right. Also trying to format so that it removes the zero value points and set the ones that are there to a custom number format of
The code works to remove the zero value points but reformatting the good ones is breaking the code. Heres my code:
Excel Formula:
"0;;;"
The code works to remove the zero value points but reformatting the good ones is breaking the code. Heres my code:
Excel Formula:
pieChart.ApplyDataLabels _
ShowValue:=True, _
AutoText:=True, _
LegendKey:=False, _
HasLeaderLines:=False, _
ShowSeriesName:=False, _
ShowCategoryName:=True, _
ShowPercentage:=False, _
ShowBubbleSize:=False, _
NumberFormat:="0;;"
'Loop through each data label and text for threshold
For Each srs In pieChart.SeriesCollection
For x = 1 To UBound(srs.Values)
If Abs(srs.Values(x)) = Threshold Then
srs.Points(x).DataLabel.Delete
End If
Next x
Next srs