controlling chart size

B

bbxrider

excel 2000
have a chart that gets redrawn as cell values change
i manipulate the axes quite a bit, etc and this can cause the size of chart
to expand and i want to keep it the original size,
so after an expansion, i recorded a macro while resizing it back to the
original size and but that code doesn't resize the chart when run in vba??
i stepped thru the code to make sure it actually gets run
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
ActiveSheet.Shapes("Chart 1").ScaleWidth 1.12, msoFalse,
msoScaleFromTopLeft
is there some prequisite i missed? or some way i need to use specifically
when
the code is run in vba?
 
N

Nicky

Hi,

Using scalewidth is probably setting the new width of the chart
relative to its existing size (not its size before you changed)

Try using width, which sets the exact width in points eg

ActiveSheet.Shapes("Chart 1").Width = 35
 

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