Solved

slicer magic

Posted on 2014-01-23
7
1,316 Views
Last Modified: 2014-01-23
Is there a VBA to multi select slicers?
Like there is a slicer group called [Rep]. I can now go and hit ctrl + the slicer values to select multiple values within the slicer group. Can the same be done with VBA – multi select slicers withn a slicer group?
slicerMagic.xlsm
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 18

Assisted Solution

by:Steven Harris
Steven Harris earned 500 total points
ID: 39803749
If you are wanting to pre-define selected items, you can use:

With ActiveWorkbook.SlicerCaches("Slicer_Rep")
        .SlicerItems("Andrews").Selected = True
        .SlicerItems("Gill").Selected = False
        .SlicerItems("Howard").Selected = False
        .SlicerItems("Jardine").Selected = True
        .SlicerItems("Jones").Selected = False
        .SlicerItems("Kivell").Selected = False
        .SlicerItems("Morgan").Selected = True
        .SlicerItems("Parent").Selected = True
        .SlicerItems("Smith").Selected = False
        .SlicerItems("Sorvino").Selected = True
        .SlicerItems("Thompson").Selected = False
End With

Open in new window

0
 

Author Comment

by:Rayne
ID: 39803877
thank you ThinkSpaceSolutions,
I was thinking of multi-selecting all the values like looping through the slicers in vba ...is that possible?

Thank you
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39803905
...multi-selecting all the values like looping through the slicer

Can you explain that a bit further?

Are you wanting to loop through each item in the slicer and enable it?  This would be the same as setting each item to 'True' at one time unless you introduce some other functions that need to happen as well.

Are you wanting to iterate through each item (appending it to the last one) in order to make a visual 'demo'?
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:Rayne
ID: 39803944
Well yes, I need to somehow loop thorugh each slicer option so that the slicer cache is updated  - as that stores the selection value in the page footer. So when I open the workbook, something needs to happen so that the slicer cache is updated with those values so when I print I see the footer already refreshed
0
 
LVL 18

Accepted Solution

by:
Steven Harris earned 500 total points
ID: 39804071
I think I know what you are after now:

ActiveWorkbook.SlicerCaches("Slicer_Rep").ClearAllFilters
ActiveWorkbook.SlicerCaches("Slicer_Rep").PivotTables(1).PivotCache.Refresh

Open in new window


You will want to add this to a Workbook Open event.
0
 

Author Comment

by:Rayne
ID: 39804335
thanks Sire
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39804548
Not a problem!
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 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