how to change font size of datalabels of two charts in a sheet

A

amrezzat

hey guys
i have two charts in a sheet
how to change the font size and AutoScaleFont of datalabels in them
through VBA??
 
J

Jon Peltier

The required syntax is discoverable using the macro recorder. The final
result would look something like this:

For Each chtob In ActiveSheet.ChartObjects
For Each srs In chtob.Chart.SeriesCollection
If srs.HasDataLabels Then
srs.DataLabels.Font.Size = 8
srs.DataLabels.AutoScaleFont = False
End If
Next
Next

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top