G
Guest
I would like to select the first chart in the sheet and set the min and max
values... the code says an object is not set... any help is appreciated!
Dim MinVal As Range
Dim MaxVal As Range
Dim ch As Chart
Set MinVal = ActiveSheet.Range("o17").Value
Set MaxVal = ActiveSheet.Range("o16").Value
ch = ActiveSheet.ChartObjects(1).Chart
For Each ch In ActiveSheet.ChartObjects
Select Case ch.ChartType
Case xlLineMarkers
With ch.Axes(xlCategory)
.MinimumScale = MinVal
.MaximumScale = MaxVal
End With
End Select
Next
End Sub
values... the code says an object is not set... any help is appreciated!
Dim MinVal As Range
Dim MaxVal As Range
Dim ch As Chart
Set MinVal = ActiveSheet.Range("o17").Value
Set MaxVal = ActiveSheet.Range("o16").Value
ch = ActiveSheet.ChartObjects(1).Chart
For Each ch In ActiveSheet.ChartObjects
Select Case ch.ChartType
Case xlLineMarkers
With ch.Axes(xlCategory)
.MinimumScale = MinVal
.MaximumScale = MaxVal
End With
End Select
Next
End Sub