My code for changing the Y-Axis was working perfectly yesterday yet does nothing today.
It monitors the minimum and max values in static cells and changes the scale based on the code below.
I know the change event is the correct one as it was working yesterday.
Could I ensure that it always runs without resorting to using a button?
There is no error message either when I run it.
It monitors the minimum and max values in static cells and changes the scale based on the code below.
I know the change event is the correct one as it was working yesterday.
Could I ensure that it always runs without resorting to using a button?
There is no error message either when I run it.
Code:
Option Explicit
Sub ChangeAxisScales_Calculate()
Dim objCht As ChartObject
For Each objCht In Sheets("Price Bridge Chart").ChartObjects
With objCht.Chart
' Value (Y) Axis
With .Axes(xlValue)
.MaximumScale = ActiveSheet.Range("L34").Value + 2000000
.MinimumScale = ActiveSheet.Range("K34").Value - 2000000
MsgBox "Max = " & .MaximumScale [COLOR=#008000]'- For Error Checking[/COLOR]
MsgBox "Min = " & .MinimumScale [COLOR=#008000]' - For Error Checking[/COLOR]
.MajorUnit = 250000 'Chart horizontal lines
End With
End With
Next objCht
End Sub