Scaling Multiple Graphs At the Same Time

  • Thread starter Thread starter adambush4242
  • Start date Start date
A

adambush4242

Is there any way to manually scale one graph and then have others change to
the same scale?

Thanks

Adam Bush
 
Set one axis, then select another and press F4. In Excel 2007 this is
practically ineffective compared to Excel 2003 and earlier.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"(e-mail address removed)"
 
Thanks for the help! That works great, however is there any way to automate
it so the graphs automatically change when you change one?

Thanks again,

Adam Bush
 
You can broaden the approach in this example:

http://peltiertech.com/Excel/Charts/AxisScaleLinkToSheet.html

This works on one specified chart:

Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$E$2"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MaximumScale = Target.Value
Case "$E$3"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MinimumScale = Target.Value
Case "$E$4"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlCategory) _
.MajorUnit = Target.Value
Case "$F$2"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue) _
.MaximumScale = Target.Value
Case "$F$3"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue) _
.MinimumScale = Target.Value
Case "$F$4"
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue) _
.MajorUnit = Target.Value
Case Else
End Select
End Sub

This works on all charts on the active sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim iChart As Long
Dim cht As Chart

For iChart = 1 To ActiveSheet.ChartObjects.Count
Set cht = ActiveSheet.ChartObjects(iChart).Chart
Select Case Target.Address
Case "$E$2"
cht.Axes(xlCategory).MaximumScale = Target.Value
Case "$E$3"
cht.Axes(xlCategory).MinimumScale = Target.Value
Case "$E$4"
cht.Axes(xlCategory).MajorUnit = Target.Value
Case "$F$2"
cht.Axes(xlValue).MaximumScale = Target.Value
Case "$F$3"
cht.Axes(xlValue).MinimumScale = Target.Value
Case "$F$4"
cht.Axes(xlValue).MajorUnit = Target.Value
Case Else
End Select
Next
End Sub

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______



"(e-mail address removed)"
 
Hi Adam,

You would need to write a VBA routine to handle that.

Cheers,
Shane
 
Back
Top