S
SAMMY
I'm having trouble using Jon Peltier's code (bastardized
below). I simply want to have both axes cross at points
based on a cell reference. Same thing for the maximum
value of the x-axis.
Ideally these cell references would be linked to another
worksheet, but I couldn't even get it to trigger a change
by manually changing the target cells....
TIA!
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
'X-AXIS = UNITS ******************
Case "$I$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes
(xlCategory) _
.CrossesAt = Target.Value
'Y-AXIS = GM% ******************
Case "$G$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes(xlValue)
_
.CrossesAt = Target.Value
'X-AXIS MAX VALUE ******************
Case "$H$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes(xlValue)
_
..MaximumScale = Target.Value
Case Else
End Select
End Sub
below). I simply want to have both axes cross at points
based on a cell reference. Same thing for the maximum
value of the x-axis.
Ideally these cell references would be linked to another
worksheet, but I couldn't even get it to trigger a change
by manually changing the target cells....
TIA!
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
'X-AXIS = UNITS ******************
Case "$I$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes
(xlCategory) _
.CrossesAt = Target.Value
'Y-AXIS = GM% ******************
Case "$G$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes(xlValue)
_
.CrossesAt = Target.Value
'X-AXIS MAX VALUE ******************
Case "$H$3"
ActiveSheet.ChartObjects("Chart 1025").Chart.Axes(xlValue)
_
..MaximumScale = Target.Value
Case Else
End Select
End Sub