+ Reply to Thread
Results 1 to 2 of 2

Copy Pivot Table Data and Paste into New File

  1. #1
    S Sainsbury
    Guest

    Copy Pivot Table Data and Paste into New File

    I have a spreadsheet with a pivot table, the table basically lists orders
    placed by customers. What I need to do is filter the pivot table so that
    only orders for a particular customer shows i.e untick "show all" and only
    select the customer I wish to view, then copy the data and insert/paste it
    into a new excel file. This process then needs to be repeated for each
    customer in the filter list.

    I have managed to do the above using a macro, however the filter list that
    shows the customer names will change often so the macro is only of any use if
    the customers never change, so what I need is a script that can do all of the
    above but also go through the filter list from start to end regardless of how
    many entries there may be or if they have changed.

    Can anyone help me? I can supply the excel file and/or screenshots.

    Thank you.

  2. #2
    Tom Ogilvy
    Guest

    Re: Copy Pivot Table Data and Paste into New File

    To loop throught the list of customers use something like
    for each itm in
    activesheet.PivotTables(1).PivotFields("Customer").PivotItems



    Next

    See Debra Dalgleish's site for hints on working with Pivot Tables, including
    using code.

    http://www.contextures.com/tiptech.html

    --
    Regards,
    Tom Ogilvy



    "S Sainsbury" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet with a pivot table, the table basically lists orders
    > placed by customers. What I need to do is filter the pivot table so that
    > only orders for a particular customer shows i.e untick "show all" and only
    > select the customer I wish to view, then copy the data and insert/paste it
    > into a new excel file. This process then needs to be repeated for each
    > customer in the filter list.
    >
    > I have managed to do the above using a macro, however the filter list that
    > shows the customer names will change often so the macro is only of any use

    if
    > the customers never change, so what I need is a script that can do all of

    the
    > above but also go through the filter list from start to end regardless of

    how
    > many entries there may be or if they have changed.
    >
    > Can anyone help me? I can supply the excel file and/or screenshots.
    >
    > Thank you.




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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