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
[/CODE]
Best regards
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
Best regards