F
FT
I have been trying to use the code that Jon posted to this
newsgroup:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Address
Case "$E$2"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MaximumScale = Target.Value
Case "$E$3"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MinimumScale = Target.Value
Case "$E$4"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MajorUnit = Target.Value
Case "$F$2"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue) _
.MaximumScale = Target.Value
Case "$F$3"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue). _
MinimumScale = Target.Value
Case "$F$4"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue) _
.MajorUnit = Target.Value
Case Else
End Select
End Sub
.. . . but I keep getting errors: either "Object doesn't
support this property or method" or, in one weird
case, "Subscript out of range". I assume this is a
question for Jon: what am I doing wrong!?
newsgroup:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Select Case Target.Address
Case "$E$2"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MaximumScale = Target.Value
Case "$E$3"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MinimumScale = Target.Value
Case "$E$4"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlCategory) _
.MajorUnit = Target.Value
Case "$F$2"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue) _
.MaximumScale = Target.Value
Case "$F$3"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue). _
MinimumScale = Target.Value
Case "$F$4"
ActiveWorkbook.Charts("Chart1").Chart.Axes
(xlValue) _
.MajorUnit = Target.Value
Case Else
End Select
End Sub
.. . . but I keep getting errors: either "Object doesn't
support this property or method" or, in one weird
case, "Subscript out of range". I assume this is a
question for Jon: what am I doing wrong!?