+ Reply to Thread
Results 1 to 3 of 3

Copy selected value from slicer

  1. #1
    Registered User
    Join Date
    10-10-2011
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2010
    Posts
    1

    Copy selected value from slicer

    Hello everyone,

    I have an excel file with a slicer in an excel sheet, and am trying to extract the value of the item that is selected in the slicer. What I'm trying to achieve is that you select an item in the slicer, and on a different sheet the value of that selected item is displayed in a certain cell. I've been able so far to display the name of the slicer, or the 1st value in the slicer, but never the selected value. This is what I'm using:

    Please Login or Register  to view this content.

    If I try to get the name of the slicer, it works fine like this:
    Please Login or Register  to view this content.
    I was expecting the ActiveItem would work the same way, but I cant seem to figure out why it won't work.

    I keep getting this error: Application-defined or object-defined error.

    Anyone have an idea what I'm doing wrong?

    Thanks in advance!

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Copy selected value from slicer

    Here's a sample function to get the selected values from the first slicercache in a workbook:
    Please Login or Register  to view this content.
    Hopefully you can adapt it for your needs.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    05-29-2014
    Posts
    1

    Re: Copy selected value from slicer

    what has been described will get you all values in the slicer whether the user selected them or not. the active item only works if a user manually picked an item from the slicer. it fails it nothing has been selected. so, how does one determine if a user has made a manual selection or not? Does anyone know. the ony way i know of is to trap for the run time error. and if it errors out then nothing has been manually selected and if it yields a value then there has. any better ideas? Thanks.

+ 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