Momo
Momo

Reputation: 2491

How to set pie chart label format as a cellformat programmatically in VBA

I'm generating a pie chart from a set of data.

I don't know where to start.....

Upvotes: 0

Views: 693

Answers (1)

teylyn
teylyn

Reputation: 35900

You can link the number format of the labels to the number format of the cell. Via the UI you'd do this by formatting the labels and on the Number tab select "Link to source".

If you run the macro recorder during that, you will get the respective VBA, i.e. link

ActiveChart.SeriesCollection(1).DataLabels.NumberFormatLinked = -1

and unlink

ActiveChart.SeriesCollection(1).DataLabels.NumberFormatLinked = 0

Upvotes: 2

Related Questions