+ Reply to Thread
Results 1 to 3 of 3

VBA to filter data from pivot table and move to new docs

  1. #1
    Registered User
    Join Date
    08-16-2016
    Location
    Illinois, USA
    MS-Off Ver
    Office 365
    Posts
    49

    VBA to filter data from pivot table and move to new docs

    I was trying to write a macro to create multiple documents based on filtered criteria from a pivot table I am sent daily, but it became clear that VBA was probably a much better solution as I kept getting 1004 errors 'unable to set the visible property of the pivotitem class'. I need help with a code that can filter Column I by employee name, then Column D by city name, and then copy everything from Columns A thru Q and paste to a new excel document, 1 document for each employee listed by name, with tabs for each city. Is this possible?

    Because this is being extracted from a pivot table, and it contains financial info, I'm unable to upload an example spreadsheet. I have uploaded a picture to give you an idea of what I am working with, with redacted names.

    Thank you in advance for any and all help you can provide.
    Attached Images Attached Images

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: VBA to filter data from pivot table and move to new docs

    I don't think you'll get takers without a sample workbook. Is there any way you can "sanitize" the data? If you have direct access to the source data, you can modify it.

    However, depending on how the spreadsheet is set up, you can recover the source data from it. If there is not a grand total of everything cell in the spreadsheet, set one up. Then double click this. Double clicking a cell in a spreadsheet recovers the source data that went into the calculation of that cell. In case of the grand total of everything, that's all the source data.

    I recommend paring the data down so you have enough to be representative of what you are doing. We don't need 100,000 rows of data when 100 will be good enough to illustrate the point.

    Then you can use CTRL-H (Find and Replace) to change things like client names and company names and RANDBEWEEN (x,y) for monetary values (copy the column and paste back as values only).

    Then switch the data source of the spreadsheet to this modified table.

    Remove all original data and you should be safe.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    08-16-2016
    Location
    Illinois, USA
    MS-Off Ver
    Office 365
    Posts
    49

    Re: VBA to filter data from pivot table and move to new docs

    Hi dflak. The way the information was being sent to me originally wasn't very conducive to creating the workbooks that were requested of me. I closed this thread and started one from scratch with data that I could actually upload as an example - and a little clearer instruction on what I'm trying to accomplish. Thank you for the reply!

+ 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. Pivot table filter not changing data in table - Using macro
    By DJDRU in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-09-2016, 06:16 AM
  2. Replies: 1
    Last Post: 09-06-2016, 04:59 AM
  3. [SOLVED] Select Automatic Report Filter in Pivot where Filter exist in Data table else select Blank
    By vinaynaran in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2016, 08:47 AM
  4. Replies: 0
    Last Post: 03-01-2014, 08:28 AM
  5. Replies: 0
    Last Post: 08-14-2013, 10:39 AM
  6. Filter data set within pivot table
    By Wa_Wa in forum Excel General
    Replies: 1
    Last Post: 03-23-2009, 03:36 PM
  7. Data filter in Pivot table
    By anandmr65 in forum Excel General
    Replies: 1
    Last Post: 09-27-2006, 09:21 AM

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