+ Reply to Thread
Results 1 to 4 of 4

pivot table placed in multiple tabs within a workbook?

Hybrid View

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Ohio, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    pivot table placed in multiple tabs within a workbook?

    Hi Excel Gurus! I’m new here and have a Pivot Table question. On a weekly basis I create a report for 9 retail locations. Each of these locations has their own tab in the workbook with information unique to that location. The data is formatted the same meaning columns A – F in each tab contain: SKU/Description/Retail Amount/QTY Sold/Volume. This raw data represents each item sold for each location and I use a pivot table to total the QTY Sold, find the Max value for the Retail Amount and total the Volume by SKU. This allows me to track SKU trends by store and as a district on the whole. The information is always formatted the same by column but contains a different number of rows based on how many SKU each location has sold. My question is how do I get the pivot table into each tab without manually clicking on each tab and recreating it? At this point I’m creating 9 pivot tables every time I run this report and the company is expanding. I’m not great at creating Macros so if this is the direction I need to take I’ll need some details. I’ve been able to create a Macro that works in one tab but it never transfers to a different tab. Sorry for the long post! Thanks!
    TL;DR: How do I insert a pivot table into multiple tabs within a workbook?

    I've added an example attachment that may make things clearer. I need to recreate the pivot table from the first tab on every tab. I hope there's a way to do this without manually using the pivot function over and over. Thanks!
    Attached Files Attached Files
    Last edited by Nick123456; 09-11-2013 at 05:27 PM. Reason: added an example attachment

  2. #2
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: pivot table placed in multiple tabs within a workbook?

    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].
    Last edited by Dimitrov; 09-12-2013 at 01:31 PM.

  3. #3
    Registered User
    Join Date
    09-11-2013
    Location
    Ohio, US
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: pivot table placed in multiple tabs within a workbook?

    Thanks for the response! I'll have to get better with Macros.

  4. #4
    Forum Contributor
    Join Date
    05-08-2013
    Location
    California
    MS-Off Ver
    Excel 2013
    Posts
    102

    Re: pivot table placed in multiple tabs within a workbook?

    Nick123456,

    First, there are many resources that you can tap into to learn about macros and VBA programming. When I got started, I used some online tutorials and books to help me learn. I hope you will have a fun journey.

    Second, if you find that my replies were helpful, click the star to the left, and if you feel this thread has satisfactorily answered your inquiry, please kindly mark it as [SOLVED].

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Extract data from a workbook with multiple tabs, into a workbook with corresponding tabs
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2013, 11:54 AM
  2. [SOLVED] Can't create a Master Pivot table from multiple worksheets in the same workbook
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 05-30-2012, 09:41 AM
  3. Creating a pivot table from multiple worksheets in one workbook
    By kiran654 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-20-2010, 07:25 PM
  4. Pivot table across multiple tabs in a workbook
    By mbrant in forum Excel General
    Replies: 4
    Last Post: 03-09-2007, 01:19 PM
  5. Help: Create Pivot Table from multiple tabs in a Spreadsheet
    By AUDIOBLASTER in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-04-2007, 12:30 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1