coes
07-23-2019, 03:12 AM
Dear All,
Appreciate if someone can help me on this code,
Basically I want to edit the axis value in certain type of Chart
But this code didn't worked.
Dim objCht As ChartObject
For Each objCht In ActiveSheet.ChartObjects
If ActiveChart.ChartType = xlBarStacked Then
With objCht.Chart
With .Axes(xlValue)
.MaximumScale = ActiveSheet.Range("M8").Value
.MinimumScale = ActiveSheet.Range("M9").Value
End With
End With
Else
With objCht.Chart
With .Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("M8").Value
.MinimumScale = ActiveSheet.Range("M9").Value
End With
End With
End If
Next objCht
Thanks in advance
Appreciate if someone can help me on this code,
Basically I want to edit the axis value in certain type of Chart
But this code didn't worked.
Dim objCht As ChartObject
For Each objCht In ActiveSheet.ChartObjects
If ActiveChart.ChartType = xlBarStacked Then
With objCht.Chart
With .Axes(xlValue)
.MaximumScale = ActiveSheet.Range("M8").Value
.MinimumScale = ActiveSheet.Range("M9").Value
End With
End With
Else
With objCht.Chart
With .Axes(xlCategory)
.MaximumScale = ActiveSheet.Range("M8").Value
.MinimumScale = ActiveSheet.Range("M9").Value
End With
End With
End If
Next objCht
Thanks in advance