zeppelinmv
New Member
- Joined
- Sep 22, 2010
- Messages
- 2
Hello everyone. I am trying to create a macro that will adjust a chart axis based on some formulas. The macro I've been tinkering with works only if I click within the cells with the desired range and hit 'enter'. My understanding of a change_event type macro was that it was run whenever any cells in the sheet change, but that doesn't seem to be happening.
Here is the code:
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$AC$14"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MaximumScale = Target.Value
Case "$AC$15"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MinimumScale = Target.Value
Case "$AC$16"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MajorUnit = Target.Value
Case Else
End Select
End Sub
The data for the chart is controlled via a drop-down menu, so I would like the macro to run whenever a choice from the drop-down is selected.
Thank you. Great site.
Here is the code:
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$AC$14"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MaximumScale = Target.Value
Case "$AC$15"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MinimumScale = Target.Value
Case "$AC$16"
ActiveSheet.ChartObjects("Chart 22").Chart.Axes(xlValue).MajorUnit = Target.Value
Case Else
End Select
End Sub
The data for the chart is controlled via a drop-down menu, so I would like the macro to run whenever a choice from the drop-down is selected.
Thank you. Great site.