I have an excel chart that I want to always be symmetrical. I am trying to write a code so that my chart will automatically adjust the x and y axes according to the value entered in a cell. The code I am using doesn't seem to be working so I am reaching out for help. Below is the code I have now and a picture of the spreadsheet. Any help would be GREATLY appreciated.
Private Sub Worksheet_Change(ByVal Target As Range)
With ActiveSheet.ChartObjects("Input_Luminaire_Data_Chart").Chart
Select Case Target.Address
'Y Axis
Case "$N$33"
.Axes(xlValue).MaximumScale = Target.Value
Case "$N$32"
.Axes(xlValue).MinimumScale = Target.Value
'X Axis
Case "$M$33"
.Axes(xlCategory).MaximumScale = Target.Value
Case "$M$32"
.Axes(xlCategory).MinimumScale = Target.Value
End Select
End With
End Sub
Bookmarks