Pie chart resizing

S

Sol Apache

Hello

Is there a way of making a series of pie charts exactly the same size not
only in the chart area but also making the pie itself the same size and in
the same position within the chart area?

If so, how can I do this? The setting will have to be done after the pies
are created because Excel dynamically changes the pie size depending upon
how much text there is in the labels and sometimes upon the number of
slices.

Thanks for any help


Sol
 
J

JE McGimpsey

Sol Apache said:
Hello

Is there a way of making a series of pie charts exactly the same size not
only in the chart area but also making the pie itself the same size and in
the same position within the chart area?

If so, how can I do this? The setting will have to be done after the pies
are created because Excel dynamically changes the pie size depending upon
how much text there is in the labels and sometimes upon the number of
slices.

This should come close. The first chart needs to have a big enough chart
area to accommodate the plotareas of the charts with longer labels.

Public Sub SameSizePieCharts()
Dim coSource As ChartObject
Dim paSource As PlotArea
Dim i As Long
With ActiveSheet.ChartObjects
Set coSource = .Item(1)
Set paSource = coSource.Chart.PlotArea
For i = 2 To .Count
With .Item(i)
.Height = coSource.Height
.Width = coSource.Width
With .Chart.PlotArea
.Height = paSource.Height
.Width = paSource.Width
.Left = paSource.Left
.Top = paSource.Top
End With
End With
Next i
End With
End Sub

If you're unfamiliar with macros, see David McRitchie's "Getting started
with macros". It's written with WinXL in mind, but most of it is
transferable (Note: WinXL's "Personal.xls" workbook is named "Personal
Macro Workbook" in MacXL, and is stored by default in the Microsoft
Office 2004:Office:Startup:Excel folder):

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
S

Sol Apache

Thank you. I shall check this out. I have just ordered Walkenbach¹s book on
Excel charts so that should help me with charting questions and using VB to
fiddle with them
 
J

JE McGimpsey

Sol Apache said:
Thank you. I shall check this out. I have just ordered Walkenbach¹s book on
Excel charts so that should help me with charting questions and using VB to
fiddle with them

Great book. (John's a great writer!)
 

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