UPDATING PIVOT TABLE / MACRO

h380am

New Member
Joined
Apr 25, 2020
Messages
14
Office Version
  1. 365
Good day to all,

I have a workbook with 6 pivot tables, each pivot table has its own DATA source in a different sheet. I've tried to use the Woorksheet change but it only update the first selection (First range) since the numbers of rows change with each update. here is a selection of sheets that contain pivot tables.

is it possible to creat a code that updates the pivot table when data source change including new rows added to it
VBA Code:
[CODE=vba]Sub PIVOT-TABLES()
    For ws = 1 To ThisWorkbook.Sheets.Count
        If (ThisWorkbook.Sheets(ws).Name = "RECAP EUROMAR-I" Or _
            ThisWorkbook.Sheets(ws).Name = "RECAP EUROMAR-II" Or _
            ThisWorkbook.Sheets(ws).Name = "RECAP EUROMAR-III" Or _
            ThisWorkbook.Sheets(ws).Name = "RECAP MOSHT-I" Or _
            ThisWorkbook.Sheets(ws).Name = "RECAP MOSHT-II" Or _
            ThisWorkbook.Sheets(ws).Name = "RECAP MOSHT-III") Then
            Application.ScreenUpdating = False


Application.ScreenUpdating = True
        End If
    Next ws
End Sub
[/CODE]

Best regards
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,214,584
Messages
6,120,387
Members
448,956
Latest member
JPav

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