Setting chart size

G

Guest

In my macro I want to create a chart or change some features of an already
existing chart. How do you set the size of a chart in a macro. when recording
a macro the code that I get is not very instructive, it just resizes the
chart in a way that is hard to use for setting the desired size. i would be
very greatful is somebody could help me!
 
G

Guest

Bloom,

There are three options in changing the size of a chart. You can scale the
whole chartobject (includes the legend, table, chart, etc.), you can change
the size of the chartobject, or you can change the size of the chart alone
(limited to the size of the chart object)

1. Scale the chartobject (shape)
Sheet1.Shapes("Chart 1").ScaleWidth 1.25, msoFalse, msoScaleFromTopLeft
Sheet1.Shapes("Chart 1").ScaleHeight 1.25, msoFalse, msoScaleFromTopLeft
scales the width and height 25% bigger

2. Change the size of the chartobject
Sheet1.ChartObjects("Chart 1").Height = 500
Sheet1.ChartObjects("Chart 1").Width = 500

3. Change the size of the chart
Sheet1.ChartObjects("Chart 1").Chart.PlotArea.Height = 300
Sheet1.ChartObjects("Chart 1").Chart.PlotArea.Width = 400

Mike
 

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