I am using Excel 2010.
I am trying to pull the string of the SlicerItems that equal True and pass it to a worksheet name. I need some help trouble shooting the code below:
Thanks in advance...
I am trying to pull the string of the SlicerItems that equal True and pass it to a worksheet name. I need some help trouble shooting the code below:
Code:
Sub SlicerName_Copy()
'
' Objective: To read what is selected by end-user with Slicer and copy the selection
' to a new worksheet name. Another words where SlicerItems = True
' pass SlicerItems value.
'
With ActiveWorkbook.SlicerCaches("Slicer_PerID_NAME")
.SlicerItems("Timmy").Selected = True
.SlicerItems("Tommy").Selected = False
.SlicerItems("Ronny").Selected = False
.SlicerItems("Ralph").Selected = False
End With
ActiveWorkbook.SlicerCaches("Slicer_PerID_NAME").SlicerItems("Timmy").Select
Selection.Copy
Sheets.Add After:=Sheets(Sheets.Count)
ActiveSheet.Select
ActiveSheet.Name = i
Range("A1").Select
End Sub
Thanks in advance...