+ Reply to Thread
Results 1 to 16 of 16

Extract data from Pivot Table

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Extract data from Pivot Table

    Hi All,

    This is probably a relatively simple macro to program but I have extremely limited experience with coding so any help is welcome.

    What I am trying to do is pull a series of specific rows from a pivot table into separate "reports"Example.xls. Reference the affixed Excel workbook under the worksheet 'Pivot Table'. I want to pull each of the different product names (Consults, MLPA, PIA, etc.) and the associated rows into a separate report. I would use the grouping function but, as you can tell, several of the rows include multiple products.

    Is there a way to pull out the rows for each of the products? I've included an example of a report I created manually by selecting the rows in the product filter drop-down.

    I also am looking to create a report that summarizes the product count (number of MF for example), the product frequency (how many times did MF show up in September) and message type count (number of Business Messaing for example).

    Again, I have no idea how to even approach this considering the lack of VBA knowledge but any help is very much appreciated.

    Example.xls
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi All,

    Would love some feedback on this before the end of the day! Thanks.

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi All,

    I really need some assistance on this task. It seems relatively straightforward, so if anyone could push me in the right direction it would be much appreciated. Thanks.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Extract data from Pivot Table

    Hi Skipper,

    I'd be looking at the Pivot Table options first without VBA. I'm also worried that 2003 might not give you exactly what you need as newer versons have move Pivot Table options.

    See the attached and be more specific on what you want.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi Marvin,

    Thanks for the response.

    The pivot table to the left of the worksheet you sent along is what I am looking for. I want to have an automatic process that produces these reports for each of the products (Consults, UMA, etc.). The problem is that I have to go through and tick the boxes for all the different variations of Consukts (Consults, UMA and then Consults, UMA, PIA).

    Also, I am trying to sort by the month instead of the days to be able to see how many times Consults sent a Business Messaging communications in December, for example. Is there a way to do this and have Excel automatically do this for several of the products? I want to be able to produce these mini-reports every couple of months.

    Skipper

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Extract data from Pivot Table

    Hi Skipper,

    There is a great answer if you upgrade to a newer version of Excel. It is called the Label Filter. I've done it with a "Contains" Label filter of "Consults". It looks like what you want, but you can't do it with version 2003. See:
    http://www.youtube.com/watch?v=c_qgU69NS1w

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi Marvin,

    That's really helpful, thanks.

    The next thing I want to do is automate this process somewhat. Two things on this:

    I. Is there a way to create an external 'search box' linked to the pivot table where someone could type in the query instead of having to go into Label Filters --> Contains?

    II. Is there a macro that could automate the process? Instead of going through and repeating the process for UMA, Consults, etc. I could press a button and have each of these mini-reports spit out for say the last 8-12 weeks.

    Thoughts?

    Thanks again!

  8. #8
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Extract data from Pivot Table

    Hi,

    Excel 2010 has a new tool called Slicers that is what I think you want. http://office.microsoft.com/en-us/ex...010359466.aspx

    Time to upgrade to a newer version?

  9. #9
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi Marvin,

    Thanks for the info, it's been really helpful. Slicers is probably what I am looking for. If you think of any macros that would allow me to pull the 'Label Filters --> Contains' funtion into a searchbox in a cell, let me know.

    Skipper

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Extract data from Pivot Table

    Hi Skipper,

    I wrote some VBA to duplicate what Slicer does before 2010 came out. I did it in 2007 version of Excel and it was ugly. I guess Microsoft found people needed this feature so they wrote it into the newer version(s). You just don't have a Label filter in 2003 for pivots.

  11. #11
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi Marvin,

    I actually do have Excel 2007, so I am able to utilize the Label Filter option, which is great.

    What I am still looking for is a basic VBA that automates the process of typing in 'Consults' or 'UMA'. It'd be great if one could simply click a button that would automatically input the 8 or so different products I wanted to pull data form, define the timeframe from which to pull the data (say between October '11 and December '11), and spit out 8 different reports. Is there a way to do this?

    If not, is there a way to create a searchbox that serves the function of the Label Filter? That is, can I create a cell that mimics this function so that one could simply type in 'Consults' into the cell and receive the report that way?

    I do appreciate all the support.

    Skipper

  12. #12
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,355

    Re: Extract data from Pivot Table

    Hi SKipper,

    You could record a macro that did each of your filters of the data and put a button on the sheet that called these macros individually. The record macro process has problems when the data for the pivot table gets bigger or when there are no records in the filter. Time to learn VBA?

  13. #13
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi Marvin,

    Thanks for the info. I've gone ahead and recorded the macros and assigned them to buttons. If you wouldn't mind assisting me in two final tasks I would be much obliged. I am reattaching an updated version.

    What I am trying to do is assign a macro to each item in a Data Validation drop-down menu (i.e. when I select 'Consults' it will run a macro associated with that word). I have been assigning a macro to each item using the following code, but cannot get it to work:

    Please Login or Register  to view this content.
    What can you recommend?

    Also is there a way to assign a color to a type of cell in a pivot table? I want to highlight all totals in dark blue and all non-totals in light blue.

    I am indebted to you!
    Attached Files Attached Files
    Last edited by Cutter; 07-31-2012 at 07:33 PM. Reason: Added code tags

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Extract data from Pivot Table

    @ Skipper Jones

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

  15. #15
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    @ Cutter,

    Thanks for the heads up, I'll be sure to do so in future posts. Any idea about the questions I posed @ Marvin?

    Appreciate all the assistance.

  16. #16
    Registered User
    Join Date
    07-27-2012
    Location
    New York, New York
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Extract data from Pivot Table

    Hi All,

    Thanks for all the help thus far.

    My final report is due Friday so I would love so assistance regarding assigning macros to drop-down (i.e. Data Validation) lists, if possible. I've tried to use the 'call' function to assign macros to specific items, but have been unable to execute the macro correctly as of yet. Any help on this would be greatly appreciated.

    Thanks!

    Skipper

+ 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