codeliftsleep
Board Regular
- Joined
- Apr 14, 2017
- Messages
- 103
Here is the dilemma I am running into.
I am designing a report that will be viewable by both managers and employees.
I have slicers attached to Employee, Level 1 Manager and Level 2 Manager fields that control all the pivot tables.
The issue is, once I run the code upon opening the workbook to determine who the user is and to set the slicers appropriately, I want to either:
A) Lock them CONDITIONALLY(which is where the problem is) or
B) Make them not visible.
For instance:
However, I cannot find anything in code that will either allow me to lock the slicers or make them hidden. This is an issue because while I can always just lock the Manager 2 slicer once its set by protecting the sheet, I can't lock the level 1 or employee slicer because some people need to be able to change them if they want.
Is there a way to do this via VBA? I am using Excel 2013
I am designing a report that will be viewable by both managers and employees.
I have slicers attached to Employee, Level 1 Manager and Level 2 Manager fields that control all the pivot tables.
The issue is, once I run the code upon opening the workbook to determine who the user is and to set the slicers appropriately, I want to either:
A) Lock them CONDITIONALLY(which is where the problem is) or
B) Make them not visible.
For instance:
- A Level 2 manager should be able to make changes to the Level 1 manager and Employe slicer so they can look at people that report to them however they want.
- A level 1 manager should only be able to make changes to the Employee slicer to see the people that report to them individually.
- An employee should not be able to make ANY chanegs to the slicers, as they are only allowed to see their data.
However, I cannot find anything in code that will either allow me to lock the slicers or make them hidden. This is an issue because while I can always just lock the Manager 2 slicer once its set by protecting the sheet, I can't lock the level 1 or employee slicer because some people need to be able to change them if they want.
Is there a way to do this via VBA? I am using Excel 2013