I have created my pivot table and pivot chart. I have added the following code to have the scale on the secondary axis match the primary axis:
The problem is that now when I use my slicer the secondary axis scale remains the same as the summary and does not adjust to match the individual selections.
VBA Code:
Dim x As Long
With ActiveSheet.ChartObjects("Pivot").Chart
ActiveSheet.ChartObjects("Pivot").Activate
ActiveChart.Axes(xlValue).MaximumScaleIsAuto = True
ActiveChart.Axes(xlValue).MinimumScale = 0
x = ActiveChart.Axes(xlValue).MaximumScale
ActiveChart.Axes(xlValue, xlSecondary).MaximumScale = x
The problem is that now when I use my slicer the secondary axis scale remains the same as the summary and does not adjust to match the individual selections.