Greetings EXCELent users,
I have a dynamic graph that does not auto scale on the lower end of the vertical axis.
I have the following code that does re-scale the graph according to values in the worksheet cells.
This code selects the graph and runs "ScaleAxes"
Sub RUNNIT()
'
' RUNNIT Macro
'
' Keyboard Shortcut: Ctrl+r
'
ActiveSheet.Shapes.Range(Array("Group 11")).Select
ActiveSheet.ChartObjects("Chart 12").Activate
Application.Run "'Graph scale test.xlsm'!ScaleAxes"
Range("A15").Select
End Sub
This actually changes the graphs axis.
Sub ScaleAxes()
With ActiveChart.Axes(xlValue, xlPrimary)
.MaximumScale = ActiveSheet.Range("$AM$1").Value
.MinimumScale = ActiveSheet.Range("$AM$2").Value
End With
End Sub
I would like to make one macro that rescales the axis and is triggered by a change in cell A1.
I have been experimenting with this
Private Sub Worksheet_Change(ByVal Target As Range)
but so far I have not found a way to actually trigger the actions of "ScaleAxes"
I would appreciate any help in combining these elements into a single VBA code that will change the graph's scaling when a value in A1 changes.
Thank you for you inputs.
Glen