largeselection
Active Member
- Joined
- Aug 4, 2008
- Messages
- 358
Hi,
So I found some info online which outlines a routine to display messageboxes which show the items contained in a slicer.
What I want to know is:
1) Is it possible to only list the items that are selected in a slicer?
2) If part 1 is possible, is it then possible to list them in a string to put in a cell?
Basically if I have say 3 slicers over a report "NAME", "YEAR", "STATE", I want the report to display a text row at the top (or even a header/footer might work) which says what has been selected.
I know I can just print out the report with the slicers visible, but I actually have many slicers and might be selecting items that are not visible within the same slicer box window.
So rather than having to type what I selected manually, I'd want it to just show in a line above the report:
Name: Henry, Carl, Joe / Year: 2011 / State: NY, NJ, NM, CA
and have it update based on whatever is selected in the slicers.
Any thoughts on how to accomplish this?
I've listed the code from Microsoft's website below which shows how to list all of the items (all items, not only selected items) in messageboxes for reference.
</PRE>
</PRE>
THANKS!
</PRE>
So I found some info online which outlines a routine to display messageboxes which show the items contained in a slicer.
What I want to know is:
1) Is it possible to only list the items that are selected in a slicer?
2) If part 1 is possible, is it then possible to list them in a string to put in a cell?
Basically if I have say 3 slicers over a report "NAME", "YEAR", "STATE", I want the report to display a text row at the top (or even a header/footer might work) which says what has been selected.
I know I can just print out the report with the slicers visible, but I actually have many slicers and might be selecting items that are not visible within the same slicer box window.
So rather than having to type what I selected manually, I'd want it to just show in a line above the report:
Name: Henry, Carl, Joe / Year: 2011 / State: NY, NJ, NM, CA
and have it update based on whatever is selected in the slicers.
Any thoughts on how to accomplish this?
I've listed the code from Microsoft's website below which shows how to list all of the items (all items, not only selected items) in messageboxes for reference.
Rich (BB code):
dim cache As Excel.slicerCache
Set cache = ActiveWorkbook.SlicerCaches("Slicer_Sales_Type")
Dim sItem As Excel.SlicerItem
For Each sItem In cache.SlicerItems
MsgBox sItem.Name
Next sItem
</PRE>
</PRE>
THANKS!
</PRE>