Hello,
I have a workbook with data and many sheets which contain various pivot tables for that data. After I create new pivot table, I want to add slicers to it. So far I was able to create the slicers the way I want:
(sname is name of the field and slicer, sxname is the name and random number (because in the workbookt there are many slicers with the same name eg month), the rest is position...)
however I would also like to modify some of its properties, such as number of columns, row height, etc
For this I need to know the slicerCaches value, which I do not control when creating.
How do I do this? Also how do I connect the slicer to all pivottables on the worksheet?
thank you very much!
I have a workbook with data and many sheets which contain various pivot tables for that data. After I create new pivot table, I want to add slicers to it. So far I was able to create the slicers the way I want:
Code:
ActiveWorkbook.SlicerCaches.Add(ActiveSheet.PivotTables(c_pt), sname).Slicers.Add ActiveSheet, , sxname, sname, pv, ph, sw, sh
however I would also like to modify some of its properties, such as number of columns, row height, etc
Code:
ActiveWorkbook.SlicerCaches("Slicer_month5").Slicers("month 5").NumberOfColumns = 2
How do I do this? Also how do I connect the slicer to all pivottables on the worksheet?
thank you very much!