ManUBlueJay

Active Member
Joined
Aug 30, 2012
Messages
303
Office Version
  1. 2016
Platform
  1. Windows
I have 2 slicers running a pivot table on a sheet called "Entry Form"
Slicer 1 is controlling a named cell called "CEF_Entry"
Slicer 2 is controlling a named range called "CEF_Type"

I would like it that when I change slicer 1 it clears Slicer 2' selection and locks my entry form requiring a selection from Slicer 2. My code does never reach the slicer 2 change
When Slicer 2 is used it unlocks my entry form.
I have used the following code in the relevant sheet code

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("CEF_Entry")) Is Nothing And Range("CEF_Type") = "(All)" Then
Exit Sub
Else
If Not Intersect(Target, Range("CEF_Type")) Is Nothing Then
Application.EnableEvents = False
CompostEntryForm
Application.EnableEvents = True
Else
If Not Intersect(Target, Range("CEF_Entry")) Is Nothing And Range("CEF_Type") <> "(All)" Then
Application.EnableEvents = False
Sheets("Entry Form").Unprotect
ActiveWorkbook.SlicerCaches("Slicer_Type").ClearManualFilter
Range("CompostEntryForm").Locked = True
Sheets("Entry Form").Protect AllowUsingPivotTables:=True, UserInterFaceOnly:=True
Application.EnableEvents = True
End If
End If
End If
End Sub
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top