VBA: Refresh all pivot tables when I delete lines in my dataset

DECOVIOTI

New Member
Joined
Dec 11, 2020
Messages
22
Office Version
  1. 2019
Platform
  1. Windows
Hello Guys
I have in my excel spreadsheet a high number of pivot tables and a worksheet called "Data". I would like to know if is possible after delete some lines in this Data tab, if the all pivot tables can be refreshed automatically.
Can you pls help me?
 

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
This is the code I have for the Worksheet_Activate event for any sheet that has a pivot table. Unless you have some cells somewhere else that use the data in the pivot tables, there is no need to update them until you go to a sheet that has pivot tables. If you do have dependent cells then you will have to attach the RefreshAll command to some other event such as Worksheet_Change.

VBA Code:
Private Sub Worksheet_Activate()
  'Pivot tables don't update automatically.  This forces an update when the user goes to this sheet.
  ThisWorkbook.RefreshAll
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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