+ Reply to Thread
Results 1 to 3 of 3

Pulling filtered data in by tabs

  1. #1
    Registered User
    Join Date
    02-13-2017
    Location
    pittsburgh
    MS-Off Ver
    2007
    Posts
    16

    Pulling filtered data in by tabs

    Hi all. I have a data set that I drop data into month in and month out. Within this data is a column with employee names, a column with employee cost centers they are under, and employee amounts spent. My company has asked me to create a report that has each and every cost center as a tab in the file and just a static template in each tab to track employee spend.. So I removed duplicates of all the cost centers and ran a macro that created 50 different tabs with all the cost center names as a template.. I cannot figure out a way to put a list of all employees that are associated with each cost center in each tab. Attached is an example of unsensitized data for just a small example. I simply dont know how to get an employee list on each tab for the relative cost center that employee falls under. Can anyone help out? any ideas? thanks

    They wont let me use a dynamic one sheet file
    If I do pivot tables I will have to create 50 pivot tables for each cost center tab.

    Again my actual data set is huge so I need something not manual
    Attached Files Attached Files
    Last edited by almst791; 02-15-2017 at 11:14 AM.

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

    Re: Pulling filtered data in by tabs

    The key to this solution is pivot tables. You can set a pivot table to give you the breakout you want. Then it's a matter of coding to loop through the cost centers and make a page for each.

    I converted the data into a table because tables know how big they are, and any pivot tables build from them will always reference exactly the right amount of data.

    I set up two pivot tables on the Pivot Sheet. The first one is actually the report itself, and the second is a list of unique cost center names. Both of these are overlaid by named dynamic ranges so the program knows how much data they return. This sheet can be hidden.

    The code loops through the Cost Center List. Sets the filter on the other pivot table and copies the results of the table to the sheet.

    On the Control Panel sheet there is a button to clear data. This button clears the contents of the data table. The intent is that you can copy and paste the new data into Cell B2.
    Attached Files Attached Files
    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
    02-13-2017
    Location
    pittsburgh
    MS-Off Ver
    2007
    Posts
    16

    Re: Pulling filtered data in by tabs

    Hi dflak,

    Excel Forum will not let me download the file you attached, keeps redirecting me to login, anyway you can email me that file
    removed e-mail

    I really appreciate you helping me and this makes sense but I have to take a look at it to understand fully.
    Last edited by jeffreybrown; 02-19-2017 at 09:54 PM. Reason: Please do not post whole quotes. It just causes clutter.

+ 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. Excel,so difficult to create this VBA project
    By OrxanTagizade in forum Hello..Introduce yourself
    Replies: 2
    Last Post: 11-22-2014, 04:02 PM
  2. difficult project, hope you can help
    By nassetas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2014, 10:05 AM
  3. Replies: 2
    Last Post: 12-20-2013, 12:12 AM
  4. A difficult problem - Excel 97
    By Sentry11 in forum Excel General
    Replies: 5
    Last Post: 08-05-2006, 06:00 AM
  5. Replies: 1
    Last Post: 02-20-2006, 06:10 PM
  6. Replies: 1
    Last Post: 10-18-2005, 11:05 AM
  7. Difficult Excel Question
    By [email protected] in forum Excel General
    Replies: 3
    Last Post: 01-27-2005, 09:06 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