J
Jase
I have this code that allows me to change the scaling of ALL charts from
specified cells I have set up. Is there a way that instead of changing all
charts that I can pick a couple particular charts instead. For instance if I
have 10 charts and I just want to rescale charts:2,5,6 and 9
Private Sub Worksheet_Change(ByVal Target As Range)
For iChart = 1 To ActiveSheet.ChartObjects.Count
Set cht = ActiveSheet.ChartObjects(iChart).Chart
With cht.Axes(xlValue)
.MinimumScale = ActiveSheet.Range("B24")
.MaximumScale = ActiveSheet.Range("B23")
End With
With cht.Axes(xlCategory)
.MinimumScale = ActiveSheet.Range("C24")
.MaximumScale = ActiveSheet.Range("C23")
End With
Next
End Sub
specified cells I have set up. Is there a way that instead of changing all
charts that I can pick a couple particular charts instead. For instance if I
have 10 charts and I just want to rescale charts:2,5,6 and 9
Private Sub Worksheet_Change(ByVal Target As Range)
For iChart = 1 To ActiveSheet.ChartObjects.Count
Set cht = ActiveSheet.ChartObjects(iChart).Chart
With cht.Axes(xlValue)
.MinimumScale = ActiveSheet.Range("B24")
.MaximumScale = ActiveSheet.Range("B23")
End With
With cht.Axes(xlCategory)
.MinimumScale = ActiveSheet.Range("C24")
.MaximumScale = ActiveSheet.Range("C23")
End With
Next
End Sub