Luke Hsu
Luke Hsu

Reputation: 179

Formatting data labels in Excel charts using VBA

I would like to change the data labels for the picture below from decimals (0.8102), like that of the blue part, to percentage (81.02%), like the red part of the stacked chart.

I have tried recording a macro but it does not show any code for the formatting of data labels.

enter image description here

Upvotes: 2

Views: 8565

Answers (1)

ActiveChart.SeriesCollection(1).DataLabels.NumberFormat = "0.00%"

Upvotes: 3

Related Questions