Hi,
I have a pivot table where I used "summarize the value", by min to determine the lowest value in a range. I want to automatically make that value my minimum chart axis value every time I change the filters for the pivot table.
When I do a cell reference in a random cell for the min value in the pivot table, it reads =GETPIVOTDATA("Min of Date Assigned",$A$7).
My chart is located on a different sheet than the pivot table. The chart sheet is named "Dates". The chart name is "Chart 1". The pivot table is located in a sheet named "PV1". The pivot tables names is "PV1".
I have tried the recorder but it returns an error when I run it. Below is the code.
Sub Macro6()
'
' Macro6 Macro
'
' Keyboard Shortcut: Ctrl+d
'
Sheets("PV1").Select
ActiveWindow.SmallScroll Down:=21
Range("B39").Select
Selection.Copy
Sheets("Dates").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = 40711
End Sub
40711 should change everytime because of the filters. It should be the min value. I have little exp with VBA. Any help would be most appreciated. Thank you for your time.
I have a pivot table where I used "summarize the value", by min to determine the lowest value in a range. I want to automatically make that value my minimum chart axis value every time I change the filters for the pivot table.
When I do a cell reference in a random cell for the min value in the pivot table, it reads =GETPIVOTDATA("Min of Date Assigned",$A$7).
My chart is located on a different sheet than the pivot table. The chart sheet is named "Dates". The chart name is "Chart 1". The pivot table is located in a sheet named "PV1". The pivot tables names is "PV1".
I have tried the recorder but it returns an error when I run it. Below is the code.
Sub Macro6()
'
' Macro6 Macro
'
' Keyboard Shortcut: Ctrl+d
'
Sheets("PV1").Select
ActiveWindow.SmallScroll Down:=21
Range("B39").Select
Selection.Copy
Sheets("Dates").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = 40711
End Sub
40711 should change everytime because of the filters. It should be the min value. I have little exp with VBA. Any help would be most appreciated. Thank you for your time.