Making charts

G

Guest

I am writing a macro that creates several charts. Now I want to be able to
assign the size of the charts (as well as the size of e.g. the plot area) in
the code so that the charts will be exactly the same size. How do you write
the code for this? When recording a macro for this I just get code that
changes the size from some default setting but how do you decide the size
directly?
 
P

paul.robinson

Hi
This is similar to setting the position of the chart

Set myChart = ChartObjects("Datachart")
With myChart.Parent
.Width = Range("C2:M2").Width
.Height = Range("C2:C10").Height
end with

or use absolute measurements instead of the range references. Of
course, you can combine postion and size inside the with...end with. I
would let the plot area take care of itself as there are usually
headings and series labels to fit on?

regards
Paul
 

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