Pivot Tables (through Power Pivot) Not Updating

BrittKnee

Board Regular
Joined
Dec 4, 2017
Messages
82
I have two parts to this:

1st: I have multiple pivot tables that I have created using Power Pivot so that I can get counts for specific categories over time (each Excel table has the historical data). When I click refresh all in Power Pivot, the new table is added, but not refreshed in the pivot table. Is there any way to refresh the pivot tables, so that the user can add data from the new table to the pivots?

2nd: Is there VBA to do the above? I have been trying to use the below code, however the new tables added will have a different name, so the table name in the code needs to be dynamic.

Any and all help is appreciated.

[Code/]
'Add New Table to Data Model

Set ws = ActiveSheet

With ws

lRow = .Range("A" & .Rows.Count).End(xlUp).Row
lCol = .Cells(1, .Columns.Count).End(xlToLeft).Column
Set rng = .Range(.Cells(lRow, 1), .Cells(lRow, lCol))

rng.Select
End With

wrk.Connections.Add2 _
"WorksheetConnection_Vacancies_Report_A.xlsm!Vacancies_1014", "", _
"WORKSHEET;S:\Vacancy Project\Vacancies_Report_A.xlsm" _
, "Vacancies_Report_A.xlsm!Vacancies_1014", 7, True, False

[/code]
Thanks.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,215,753
Messages
6,126,677
Members
449,327
Latest member
John4520

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