Chiemi Yokota
New Member
Hello,
I have a slicer which value consists of Fiscal week (1 - 53). Each week when I refresh my powerpivot, I would like to select weeks from 1 thru last week.
The code is attached below, and it gets stuck at ".slicerItems(i) ..." line. Any help would be much appreciated!!!
Thank you!!!
I have a slicer which value consists of Fiscal week (1 - 53). Each week when I refresh my powerpivot, I would like to select weeks from 1 thru last week.
The code is attached below, and it gets stuck at ".slicerItems(i) ..." line. Any help would be much appreciated!!!
Code:
Sub Test4()
Worksheets("Top 20 - YTD").Select
Dim CY_WK As Integer
CY_WK = Sheets("Note").Range("A2").Value
Dim i As Integer
With ActiveWorkbook.SlicerCaches("Slicer_theBookedWeek2")
For i = 1 To CY_WK
.SlicerItems(i).Selected = True
Next i
End With
End Sub
Thank you!!!