Scaling Multiple Graphs At the Same Time

A

adambush4242

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

Thanks

Adam Bush
 
J

Jon Peltier

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)"
 
A

adambush4242

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
 
J

Jon Peltier

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)"
 
S

Shane Devenshire

Hi Adam,

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

Cheers,
Shane
 

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