You may not need to recreate the pivot tables each time. If you can use the same spreadsheet over and over again and are willing to clear the data for each location, you can simply refresh the pivot table. For example, consider your Location 1 tab. If you clear out the data (leave the column headings intact), then paste in new data, you simply refresh the pivot table. The refreshed pivot table should pick up the new set of data. This should be an improvement over what you are doing now (i.e., building a new pivot table for each location each month). Refreshing a pivot table does not require a macro. Just click anywhere in your pivot table, and you will be taken to your pivot table tools (in your ribbon). Under the ANALYZE menu, there should be a refresh option. Click that.
However, you will eventually get tired of manually refreshing each pivot table. What you can then do is to write a macro that automatically goes into each tab and refreshes that tab's pivot table (after you put in new data each month). You can do this with loops in VBA. At this point, you will need to implement this with a macro. Here is VBA code that should help:
Sub RefreshMyPivots()
Dim w As Worksheet
Dim p As PivotTable
For Each w In Worksheets
For Each p In w.PivotTables
p.RefreshTable
p.Update
Next p
Next w
End Sub
Hope this points you in the right direction.
_________________________________
1. If this reply was helpful, click the star to the left.
2. If this reply answered your question, mark this thread as [SOLVED].
Bookmarks