ETA: I solved it myself by changing the code to the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$3" Then Page_Change
If Target.Address = "$B$6" Then VP_Change2
End Sub
Sub Page_Change()
' This changes a Page Field to a set value.
ActiveSheet.PivotTables("pivot").PivotFields("Anniversary Month").CurrentPage _
= Range("G3").Value
Cells.Select
Selection.Interior.ColorIndex = 2
Range("A14").Select
End Sub
Sub VP_Change2()
' This changes a Page Field to a set value.
ActiveSheet.PivotTables("pivot").PivotFields("VP").CurrentPage _
= Range("B6").Value
Cells.Select
Selection.Interior.ColorIndex = 2
Range("A14").Select
End Sub
I have the following code which is supposed to select a page value based on what is selected in cell B6 (a validation list). But it's not working...it's just doing nothing. It's working on one Pivot Table that only has one Page Field, but this table has 2 and it's not working:
Private Sub WorksheetVP_Change(ByVal Target As Range)
If Target.Address = "$B$6" Then VP_Change2
End Sub
Sub VP_Change2()
' This changes a Page Field to a set value.
ActiveSheet.PivotTables("pivot").PivotFields("VP").CurrentPage _
= Range("B6").Value
Cells.Select
Selection.Interior.ColorIndex = 2
Range("A14").Select
End Sub
Bookmarks