![]() |
Align y-axes on charts
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.; |
Align y-axes on charts
"MikeCM" wrote: 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 |
Align y-axes on charts
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 ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "MIKE215" wrote in message ... "MikeCM" wrote: 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 |
Align y-axes on charts
thanks to both of you for this - these are useful pointers. Many thanks
for providing some direction! Mike Jon Peltier wrote: 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 ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions http://PeltierTech.com _______ "MIKE215" wrote in message ... "MikeCM" wrote: 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 |
All times are GMT +1. The time now is 10:31 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com