Charts | Same primary and secondary axis automatically

hvieira

New Member
Joined
Nov 25, 2013
Messages
6
Hi,

Is it possible to set the same scale (e.g. min, max) on both the primary and secondary axis of a chart?

If so, does it have to be via a macro?

I know it is possible to do it manually, however when we have dynamic data this is an issue...

Thank you!

Henrique Vieira


P.S.: I'm currently using Excel 2007.
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
This may not work exactly as you want, but it's worth a trial.

If you delete the secondary axis, the series plotted on that secondary axis uses the same range as the primary axis. The series still remains on the secondary axis, just the scale should change.
 
Upvote 0
thisoldman,

Your suggestion works just fine! :)

I guess most times we simply miss the obvious answers!

Thank you for you reply and help!
 
Upvote 0
I've been struggling with this as well. I have a very dynamic graph. Not only am I using dynamic values, but depending on the type of data that the user wants to view, the graph type would also change.
I ended up using VBA, and pointing to a cell that calculates for any situation (line or stacked etc.) the max value

Code:
Dim lngMaxScale As Long
    lngMaxScale = Sheet22.Range("C93").Value

    ActiveChart.Axes(xlValue, xlPrimary).MinimumScale = 0
    ActiveChart.Axes(xlValue, xlPrimary).MaximumScale = lngMaxScale
    ActiveChart.Axes(xlValue, xlSecondary).MinimumScale = 0
    ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = lngMaxScale
 
Upvote 0

Forum statistics

Threads
1,216,088
Messages
6,128,744
Members
449,466
Latest member
Peter Juhnke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top