Adjusting Y axis scale of a chart using a scrollbar?
Ignore the below .
I dropped my code in the Workbook_SheetCalculate event and heypresto.
Thanks Again!
"Brad" wrote:
Thanks. You've sent me off on a new path, but I haven't quite been able to
crack it yet.
What I have is the slider (scrollbar) updating a value on Sheet1 in cel H1.
I then try to grab this value and use it as my maximum Y axis value. I put
the below code in the Workbook_SheetChange event. I can see it update the
value on the sheet but it doesn't update the graph's y axis value.
However when I go into the sheet and update a cell my graph will change.
What is it that I'm missing?
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
MyValue = Sheets("Sheet1").Cells(1, 8).Value
Sheets("Sheet1").ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
With ActiveChart.Axes(xlValue)
.MaximumScale = MyVal
.MinorUnitIsAuto = True
.MajorUnitIsAuto = True
.DisplayUnit = xlNone
End With
End Sub
Ta
Brad
"OssieMac" wrote:
Hi Brad,
|