Dear All,
this is my first post and I hope I stick to the rules.
I have the following problem. I have a pivot graph connected to a slicer with different company names. In a different flat Pivot table I list the companies by market share and I would now like to only select the first 4 Companies by market share for the previously mentioned pivot graph.
I tried selecting the Companies manually and record my macro which looks like this:
Sub TopFiveCompanies()
'
' TopFiveCompanies Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
ActiveWorkbook.SlicerCaches("Slicer_Company").VisibleSlicerItemsList = Array( _
"[All Data Table 1].[Company].&[Company A]")
ActiveWorkbook.SlicerCaches("Slicer_Company").VisibleSlicerItemsList = Array( _
"[All Data Table 1].[Company].&[Company D]", "[All Data Table 1].[Company].&[Company C]" _
, "[All Data Table 1].[Company].&[Company B]", _
"[All Data Table 1].[Company].&[Company A]")
End Sub
I now somehow need to link the Companies to their respective cells:
Company A = B30
Company B = B31
Company C = B32
Company D = B33
I am not quite sure if this way even works, but it seemed the easiest way at first. I also tried googling the problem but could not find a solution that worked for me.
Any help is appreciated.
Thank you!
this is my first post and I hope I stick to the rules.
I have the following problem. I have a pivot graph connected to a slicer with different company names. In a different flat Pivot table I list the companies by market share and I would now like to only select the first 4 Companies by market share for the previously mentioned pivot graph.
I tried selecting the Companies manually and record my macro which looks like this:
Sub TopFiveCompanies()
'
' TopFiveCompanies Macro
'
' Keyboard Shortcut: Ctrl+Shift+T
'
ActiveWorkbook.SlicerCaches("Slicer_Company").VisibleSlicerItemsList = Array( _
"[All Data Table 1].[Company].&[Company A]")
ActiveWorkbook.SlicerCaches("Slicer_Company").VisibleSlicerItemsList = Array( _
"[All Data Table 1].[Company].&[Company D]", "[All Data Table 1].[Company].&[Company C]" _
, "[All Data Table 1].[Company].&[Company B]", _
"[All Data Table 1].[Company].&[Company A]")
End Sub
I now somehow need to link the Companies to their respective cells:
Company A = B30
Company B = B31
Company C = B32
Company D = B33
I am not quite sure if this way even works, but it seemed the easiest way at first. I also tried googling the problem but could not find a solution that worked for me.
Any help is appreciated.
Thank you!