Solved

Get Value from Slicers in Excel 2010

Posted on 2014-03-20
2
6,091 Views
Last Modified: 2014-04-11
How can I refer to the value (filter) of a slicer in Excel?

Example: My slicers is used as a filter for different departments. When I select one department, the pivot data changes accordingly, and I want the name (slicer value) of this department to be displayed in one on the cells at the top of the worksheet.

Range("A1").Value = <your answer here>

Any clues?
0
Comment
Question by:PerMagnusStrom
2 Comments
 
LVL 49

Expert Comment

by:Rgonzo1971
ID: 39944570
Hi,

The syntax is like this

ActiveWorkbook.SlicerCaches("Slicer_ContactType").SlicerItems("Client").Selected = True

Open in new window

Regards
0
 
LVL 11

Accepted Solution

by:
jkpieterse earned 500 total points
ID: 39944840
If the slicer is connected to a powerpivot pivottable you can use the CUBERANKEDMEMEBER function to get a list of selected sliceritems.
Other wise a VBA UDF is required.

Look at this page for some info on slicers and VBA:
http://www.jkp-ads.com/articles/slicers00.asp
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Finding a closest match in Excel 7 47
sumifs excel 2013 3 15
Return Column Number based on a specific value 25 26
Formula Help 3 22
A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question