Pivot table Refresh from a change to data validation list change

wisemank

Board Regular
Joined
Jun 21, 2010
Messages
129
I would like to have my pivot table refresh from the drop down data selected. I am refreshing the "Hours required" by selecting different scenarios. This is what I did and nothing updates. The data on my dataset updates but not the pivot table.

Sub UpdateSummary()
'
' UpdateSummary Macro
' Refreshes the Pivot Summary

Range("M4").Select

ActiveWorkbook.RefreshAll
End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
If you right click on the Tab (sheet name) of the sheet with the input cell and select View Code.
Then in the window that it takes you to paste in the following, does it do what you want ?
(Change the M4 in the intersect line to the input cell)

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("M4")) Is Nothing Then   '<--- put the address of your input cell here
        Application.EnableEvents = False
        ' UpdateSummary Macro
        ' Refreshes the Pivot Summary
        Range("M4").Select
        ActiveWorkbook.RefreshAll
        Application.EnableEvents = True
    End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top