Hi all,
I've got a 'Summary' worksheet with a number of slicers and on a different sheet (called 'Risks') I have a macro that creates a new slicer on the 'Summary' sheet based on the name entered in a specific cell and sizes and places it according to numbers entered in specific cells. The issue is that when the new slicer is made, one of the default properties is to 'move but don't size with cells' and I want to make it 'don't move or size with cells'.
I know how to do this manually but don't know how to add the VBA code for doing it to the bottom of my existing 'Create slicer' macro:
Sheets("Summary").Activate
slicer_name = Sheets("Risks").Range("Risk_Type").Value
ActiveWorkbook.SlicerCaches.Add2(ActiveSheet.PivotTables("PivotTable2"), slicer_name).Slicers.Add ActiveSheet, , slicer_name, slicer_name, Sheets("Risks").Range("Slc_Vrt").Value, Sheets("Risks").Range("Slc_Hzt").Value, Sheets("Risks").Range("Slc_Width").Value, Sheets("Risks").Range("Slc_Height").Value
Any help would be greatly appreciated.
Thanks,
N
I've got a 'Summary' worksheet with a number of slicers and on a different sheet (called 'Risks') I have a macro that creates a new slicer on the 'Summary' sheet based on the name entered in a specific cell and sizes and places it according to numbers entered in specific cells. The issue is that when the new slicer is made, one of the default properties is to 'move but don't size with cells' and I want to make it 'don't move or size with cells'.
I know how to do this manually but don't know how to add the VBA code for doing it to the bottom of my existing 'Create slicer' macro:
Sheets("Summary").Activate
slicer_name = Sheets("Risks").Range("Risk_Type").Value
ActiveWorkbook.SlicerCaches.Add2(ActiveSheet.PivotTables("PivotTable2"), slicer_name).Slicers.Add ActiveSheet, , slicer_name, slicer_name, Sheets("Risks").Range("Slc_Vrt").Value, Sheets("Risks").Range("Slc_Hzt").Value, Sheets("Risks").Range("Slc_Width").Value, Sheets("Risks").Range("Slc_Height").Value
Any help would be greatly appreciated.
Thanks,
N