Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6867
  • Last Modified:

Get Value from Slicers in Excel 2010

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
PerMagnusStrom
Asked:
PerMagnusStrom
1 Solution
 
Rgonzo1971Commented:
Hi,

The syntax is like this

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

Open in new window

Regards
0
 
jkpieterseCommented:
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now