Good afternoon everyone,
I have the following code below which I am using to re-label the X axis on several graphs:
[/CODE]
Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("A1") Or Target = Range("B1") Then
ActiveSheet.ChartObjects("Chart 1").Activate
With ActiveChart.Axes(xlCategory)
If Range("A1").Value <> "" Then .MinimumScale = Range("A1").Value
If Range("B1").Value <> "" Then .MaximumScale = Range("B1").Value
End With
End If
End Sub
[/CODE]
My problem is that this works for re-labeling the first graph but I am not experienced enough with VBA to figure out how to loop the macro for multiple graphs. Just as a heads up, I have "A1" set to 0 for the start of my X axis and "B1" is a count from another page so when additional data is added the count will increase.
Any help would be much appreciated.
Thanks,
Corey
Bookmarks