Sub UpdateScale()
Dim ChartVar As chart
Dim lMax As Long, lMin As Long
Dim i As Integer
On Error GoTo ScalingProblem
'Assigns the values in the Min and Max ranges to variables.
With Sheet1
lMax = .Range("Max").Value
lMin = .Range("Min").Value
For i = 1 To ActiveSheet.ChartObjects.Count
'Creates chart object.
Set ChartVar = .ChartObjects(i).chart
With ChartVar.Axes(xlValue, xlPrimary)
'Adjusts the price axis
.MinimumScale = lMin
.MaximumScale = lMax
End With
Next
End With
Exit Sub
ScalingProblem:
RetrievalProblem:
MsgBox "Unable to update chart scale.", vbCritical + vbOKOnly, "Scaling Error"
End Sub