i have the following that changes the x axis scale based on a value on a worksheet, it works fine until i change
to
can someone explain why this won't work?
Cheers, Craig
Si fractum non sit, noli id reficere
Code:
[red]With ActiveChart.Axes(xlCategory)[/red]
.MinimumScale = minScaleValue
.MaximumScale = maxScalevalue
End With
Code:
[red]With oSPCCht.Axes(xlCategory)[/red]
.MinimumScale = minScaleValue
.MaximumScale = maxScalevalue
End With
Code:
Function updateSPCcht()
Dim minScaleValue
Dim maxScalevalue
Dim oDataSh As Worksheet
Dim oSPCCht As ChartObject
Set oDataSh = Worksheets("Page1 SPC")
Set oSPCCht = Worksheets("printsheet").ChartObjects("SPC Chart 1")
maxScalevalue = oDataSh.Range("j1").Value
minScaleValue = maxScalevalue - 196
[red]With ActiveChart.Axes(xlCategory)[/red]
.MinimumScale = minScaleValue
.MaximumScale = maxScalevalue
End With
End Function
Cheers, Craig
Si fractum non sit, noli id reficere