Worksheet with combo boxes. User selects combos linked to a cell and the chart changes according to selections. Need the axis to also adjust to my named ranges. I would like this to be upon a worksheet_change vs manually calling the macro/code if possible.
I've tried many different ways of doing this and have nothing workable yet. I need this asap and have spent many many hours researching this from examples.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ch As ChartObject
Set ch = Worksheets(Summary).ChartObjects("Chart 16").Select
With ch.Axes(xlValue, xlSecondary)
.MinimumScale = ActiveSheet.Name("MinScale_LP")
.MaximumScale = ActiveSheet.Name("MaxScale_LP")
End With
With ch.Axes(xlValue, xlSecondary)
.MinimumScale = Summary.Name("MinScale_GFWC")
.MaximumScale = Summary.Name("MaxScale_GFWC")
End With
End Sub
This did not work either:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.ChartObjects("Chart 16").Chart.Axes(xlValue).MaximumScale = MaxScale_LP
ActiveSheet.ChartObjects("Chart 16").Chart.Axes(xlValue).MinimumScale = MinScale_LP
ActiveSheet.ChartObjects("Chart 16").Chart.Axes(xlValue, xlSecondary).MaximumScale = MaxScale_GFWC
ActiveSheet.ChartObjects("Chart 16").Chart.Axes(xlValue, xlSecondary).MinimumScale = MinScale_GFWC
End Sub
Range("MaxScale_LP")
syntax.