Hello,
I'm trying to link my chart's scale to parameters set in cells E2:E4, using the code shown below. I've seen variations of this code online and people say it works for them, but my chart doesn't scale to the values in E2:E4. Does anyone have any ideas??
Jill
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MaximumScale = [E2]
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MinimumScale = [E3]
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MajorUnit = [E4]
End Sub
I'm trying to link my chart's scale to parameters set in cells E2:E4, using the code shown below. I've seen variations of this code online and people say it works for them, but my chart doesn't scale to the values in E2:E4. Does anyone have any ideas??
Jill
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MaximumScale = [E2]
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MinimumScale = [E3]
ActiveSheet.ChartObjects("Chart 1").Chart.Axes(xlValue).MajorUnit = [E4]
End Sub