D
Dale
I am trying to have a pivot table react to a change in this dropdown
box. The user clicks on 2 groups of option buttons first but after the
code gets to this line "pfTYPE.CurrentPage = strPI(1)", it won't go any
further. This changes the first page field but won't go beyond this.
What am I doing wrong ?
Sub DropDown937_Change()
Dim pt As PivotTable
Dim pfTYPE As PivotField
Dim pfRIM As PivotField
Dim pfSIZE As PivotField
Dim pi As PivotItem
Dim strPI(1 To 3) As String
Dim i As Integer
Set pt = ActiveSheet.PivotTables(1)
Set pfTYPE = pt.PivotFields("TYPE")
Set pfRIM = pt.PivotFields("RIM")
Set pfSIZE = pt.PivotFields("SIZE")
Application.ScreenUpdating = False
Range("X1").Select
strPI(1) = ActiveCell
Range("X2").Select
strPI(2) = ActiveCell
Range("X3").Select
strPI(3) = ActiveCell
pfTYPE.CurrentPage = strPI(1)
pfRIM.CurrentPage = strPI(2)
pfSIZE.CurrentPage = strPI(3)
Range("A1").Select
Application.ScreenUpdating = True
End Sub
box. The user clicks on 2 groups of option buttons first but after the
code gets to this line "pfTYPE.CurrentPage = strPI(1)", it won't go any
further. This changes the first page field but won't go beyond this.
What am I doing wrong ?
Sub DropDown937_Change()
Dim pt As PivotTable
Dim pfTYPE As PivotField
Dim pfRIM As PivotField
Dim pfSIZE As PivotField
Dim pi As PivotItem
Dim strPI(1 To 3) As String
Dim i As Integer
Set pt = ActiveSheet.PivotTables(1)
Set pfTYPE = pt.PivotFields("TYPE")
Set pfRIM = pt.PivotFields("RIM")
Set pfSIZE = pt.PivotFields("SIZE")
Application.ScreenUpdating = False
Range("X1").Select
strPI(1) = ActiveCell
Range("X2").Select
strPI(2) = ActiveCell
Range("X3").Select
strPI(3) = ActiveCell
pfTYPE.CurrentPage = strPI(1)
pfRIM.CurrentPage = strPI(2)
pfSIZE.CurrentPage = strPI(3)
Range("A1").Select
Application.ScreenUpdating = True
End Sub