ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   how to change font size of datalabels of two charts in a sheet (https://www.excelbanter.com/charts-charting-excel/87530-how-change-font-size-datalabels-two-charts-sheet.html)

amrezzat

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

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


--
amrezzat
------------------------------------------------------------------------
amrezzat's Profile: http://www.excelforum.com/member.php...o&userid=28766
View this thread: http://www.excelforum.com/showthread...hreadid=540051


Jon Peltier

how to change font size of datalabels of two charts in a sheet
 
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/
_______

"amrezzat" wrote in
message ...

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

--
amrezzat





All times are GMT +1. The time now is 05:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com