• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Slicer and Macro Drop Down

Dennecker

New Member
Hello,

I have set up an advanced filter with a macro and slicers. The slicers allow choosing options under headers, then the macro is run to filter the data. So if a member selects Principal in the slicer, runs the macro, the data filters to Principal.

My problem is, if a member selects Superintendent, the macro runs and pulls both Superintendent and Superintendent Secretary. If I filter to Superintendent in the table, it only filters Superintendent.

Sub GetDataForSlicersSel()

Dim wsPF As Worksheet
Dim wsSD As Worksheet
Dim wsOP As Worksheet

Set wsPF = Sheets("Slider")
Set wsSD = Sheets("Data")
Set wsOP = Sheets("Output")

wsSD.Range("DataTable[#All]").AdvancedFilter _
Action:=xlFilterCopy, _
CriteriaRange:=wsPF.Range("CriticalSlicers"), _
CopyToRange:=wsOP.Range("ExtractSlicer"), _
Unique:=False
End Sub

Please assist.
 
Back
Top