Sizing individual charts with a macro

G

Guest

Hi,

I'm kind of flying along through VB on a wing and a prayer, so would really
appreciate some help with sizing individual charts in Excel. I have found
some coding for resizing all the charts on a sheet, but really need to be
able to click on a chart and resize them individually.

I can manage it as long as I have selected the chart with the Select cursor
(from the Drawing menu) and it is seen as a shape, but if I am in the chart
in editing mode, I get a run-time error 438, and the message 'Object doesn't
support this property or method'.

I'm in Excel 2003.

Many thanks,
Eleanor
 
A

Andy Pope

Hi,

If the chart is active then use the Parent reference to apply sizes

This will make the chart 10% wider.

ActiveChart.Parent.Width = ActiveChart.Parent.Width * 1.1

Cheers
Andy
 
G

Guest

Thanks, that's really helpful. How would I assign a fixed height and width
to this? I tried using points, and the chart nigh on disappeared to about
0.5x0.5cm!
 
A

Andy Pope

Not sure what value you used.

This will nake the chart as wide as the columns D:J

ActiveChart.Parent.Width=range("D:J").Width

Cheers
Andy
 

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