+ Reply to Thread
Results 1 to 11 of 11

capture subtotals, slicer information from VBA?

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    capture subtotals, slicer information from VBA?

    in a pivot table i would like to capture the subtotal of a person based on if the the slicer name is the same as the column name

    if the slicer name = column name then retrieve that subtotal of that person.....how can I go about achieving this in vba in a particular cell?

    thanks.

  2. #2
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    anyone have a clue

  3. #3
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    ............................

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: capture subtotals, slicer information from VBA?

    Can you provide a sample workbook showing precisely what it is you want to test. It's not 100% clear to me yet.
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    sample.xlsx

    Here is the attached sample data...i would like to know how I could show the # and % of subtotals if the slicer name is the same as the column name aside from the pivot table.

    Thanks for the help
    Last edited by murd; 08-12-2012 at 09:09 PM.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: capture subtotals, slicer information from VBA?

    There appear to be multiple subtotals for each slicer value so which values are you actually trying to retrieve?

  7. #7
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    right! Now if I click on the slicer item(any single name) I only want the subtotal of that same name(from the slicer)...so I only need the subtotal of whatever the slicer name I click on

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: capture subtotals, slicer information from VBA?

    Isn't that just the grand total, since your slicer field is not in the table?

  9. #9
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    No that would be all of the patients combined (visited+responsible = grand total)
    I would like to have (the visited that WAS ALSO responsible so...slicer name = visited provider name) which is subtotal.[COLOR="Silver"]



    for example....if i click John doe for the slicer item....in the pivot table John doe(visited provider) should have a subtotal of #25...and %25 out of grand total 100. so i would like to only show John doe's subtotals

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,274

    Re: capture subtotals, slicer information from VBA?

    OK, I see. The simplest way is to add your slicer field as a report filter so that the selected value appears in a cell, then you can refer to that cell in a GETPIVOTDATA formula. See attached version of your file.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-10-2012
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: capture subtotals, slicer information from VBA?

    THANK YOU VERY MUCH!!!!! you save further headache

+ 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