Resizing Chart window using VBA

B

Barb Reinhardt

Using VBA, how do I resize a chart window to be the same on all worksheets
within the workbook

I have something like this already:

For Each aWS In ActiveWorkbook.Worksheets
For Each objChart In aWS.ChartObjects
...blah blah blah
'objChart.ScaleWidth 1, msoFalse, msoScaleFromTopLeft
'objChart.ScaleHeight 1, msoFalse, msoScaleFromBottomRight
next objchart
next aWS

I believe the objchart.scale ... lines just change the height or width to a
ratio of the current height or width. What I want is to have all of the
chart windows within the workbook be the same size.

Thanks
 
J

Jon Peltier

Hi Barb -

Try this:

For Each aWS In ActiveWorkbook.Worksheets
For Each objChart In aWS.ChartObjects
objChart.Width = <width>
objChart.Height = <height>
next objchart
next aWS

- Jon
 

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