countryfan_nt
Well-known Member
- Joined
- May 19, 2004
- Messages
- 765
Hello friends, Hope all is well!
The VB has a bug. Trying to filter a PivotTable with a cell value (CB2).
I got the bug: unable to get the pivotfields property of the worksheet class
And the following line is highlighted: Set xPFile = xPTable.PivotFields("Month")
Your kind & continuous help is needed and always appreciated.
The VB has a bug. Trying to filter a PivotTable with a cell value (CB2).
I got the bug: unable to get the pivotfields property of the worksheet class
And the following line is highlighted: Set xPFile = xPTable.PivotFields("Month")
Your kind & continuous help is needed and always appreciated.
Code:
Sub Slice1()
Dim xPTable As PivotTable
Dim xPFile As PivotField
Dim xStr As String
Application.ScreenUpdating = False
Set xPTable = Worksheets("RNO").PivotTables("RNO1")
Set xPFile = xPTable.PivotFields("Month")
xStr = M = Worksheets("RNO").Range("CB2").Value
xPFile.ClearAllFilters
xPFile.CurrentPage = xStr
Application.ScreenUpdating = True
End Sub