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.
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.