View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_7_] Jon Peltier[_7_] is offline
external usenet poster
 
Posts: 115
Default Looping through to stop on pie charts

Daniel -

Your macro should look like this:

Sub PieChartFonts8pt()
Dim sh As Object
Dim ch As Chart
Dim cho As ChartObject

' Get Chart Sheets
For Each ch In ActiveWorkbook.Charts
Select Case ch.ChartType
Case xlPie, xlPieExploded, xl3DPie, xl3DPieExploded
ch.ChartArea.Font.Size = 8
End Select
Next

' Get Embedded Charts
For Each sh In ActiveWorkbook.Sheets
For Each cho In sh.ChartObjects
Select Case cho.Chart.ChartType
Case xlPie, xlPieExploded, xl3DPie, xl3DPieExploded
cho.Chart.ChartArea.Font.Size = 8
End Select
Next
Next
End Sub

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


Daniel Bonallack wrote:

Could someone please tell me how to loop through a
workbook and make the font of pie charts 8pt (and only
pie charts)?

Thanks in advance

Daniel