Align y-axes on charts

M

MikeCM

I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;
 
G

Guest

MikeCM said:
I have a nuimber of sets of 3 charts, with each trio being linked but
differing quantities. The y-axis scales in each of the 3 charts are
automatic and hence do not align, which prevents easy cross-review.
Does anyone have any suggestions that will look at the first chart
maximum value on the y-axis and apply this maximum to the scale of the
other 2 charts? Thanks for any suggestions.;

Hi Mike,

Try this. It will copy the entire format of chart 1 not just the max and
min on the axis. Just make sure to check your titles after this.

Sub ChartMatch()
Dim cobj As ChartObject
ActiveSheet.ChartObjects(1).Activate
ActiveChart.ChartArea.Select
ActiveChart.ChartArea.Copy

For Each cobj In ActiveSheet.ChartObjects
cobj.Activate
ActiveChart.ChartArea.Select
ActiveChart.Paste Type:=xlFormats
Next
ActiveChart.Deselect
Set cobj = Nothing
End Sub

Regards,
Mike
 
J

Jon Peltier

Here's a way which doesn't require code, especially code that changes
everything. (Also, if the first chart scales its axes automatically, it will
not change the scale on the others, which will still scale automatically.)

Make a dummy data range which has the minimum and maximum values for all
three data ranges:

Xmin Ymin
Xmax Ymax

Add this range to each chart as another series, and format the new series to
be hidden (no markers, no lines). All three charts will use these values in
their autoscaling, so all will have the same axis scale parameters.

- Jon
 
M

MikeCM

thanks to both of you for this - these are useful pointers. Many thanks
for providing some direction!
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