Thankyou12
Technical User
Hello,
I'm new to Excel programming. I inherited a report created using Excel 2003. The charts on the report have a scale that changes based on a combo box value. It works fine in 2003 but in 2007 the scale remains fixed. The line graph on the charts falls off the grid for certain combo box values as the scale dosen't change. I have enabled macros and I don't get any error messages. Below is the code. Any help is appreciated. Thanks!
Code:
Private Sub ComboBox1_Change()
On Error GoTo 1
With Worksheets("Supply").ChartObjects(2).Chart.Axes(xlValue)
.MaximumScale = Range("AF2").Value
.MinimumScale = Range("AF3").Value
End With
With Worksheets("Supply").ChartObjects(1).Chart.Axes(xlValue)
.MaximumScale = Range("AE2").Value
.MinimumScale = Range("AE3").Value
End With
I'm new to Excel programming. I inherited a report created using Excel 2003. The charts on the report have a scale that changes based on a combo box value. It works fine in 2003 but in 2007 the scale remains fixed. The line graph on the charts falls off the grid for certain combo box values as the scale dosen't change. I have enabled macros and I don't get any error messages. Below is the code. Any help is appreciated. Thanks!
Code:
Private Sub ComboBox1_Change()
On Error GoTo 1
With Worksheets("Supply").ChartObjects(2).Chart.Axes(xlValue)
.MaximumScale = Range("AF2").Value
.MinimumScale = Range("AF3").Value
End With
With Worksheets("Supply").ChartObjects(1).Chart.Axes(xlValue)
.MaximumScale = Range("AE2").Value
.MinimumScale = Range("AE3").Value
End With