Hello. I have a worksheet where I have multiple pivot tables that I want to filter on 1 text cell. I can get the first table to work but cannot get the second pivot table to flow. The VBA I'm using is shown below. The items with the A or 1 behind the name are not properly flowing (Pivot Table 4) Also, I have named the text Cell as "PCPFilterRange." I'm not very familiar with VBA but found some information online but not completely sure how to alter it. Please let me know any suggestions

My macro For the non-working portion
Sub Macro2()
'
' Macro2 Macro
'

'
With ActiveSheet.PivotTables("PivotTable4").PivotFields("Member")
.PivotItems("[Name]").Visible = True

End With
End Sub


My VBA in total
Option Explicit

Const PCPRangeName As String = "PCPFilterRange"
Const PivotTableName As String = "PivotTable3"
Const PivotTableName1 As String = "PivotTable4"
Const PivotFieldName As String = "PCP"


Public Sub UpdatePivotFieldFromRange(RangeName As String, FieldName As String, _
PivotTableName As String)

Dim rng As Range
Set rng = Application.Range(RangeName)

Dim pt As PivotTable
Dim Sheet As Worksheet
For Each Sheet In Application.ActiveWorkbook.Worksheets
On Error Resume Next
Set pt = Sheet.PivotTables(PivotTableName)
Next
If pt Is Nothing Then GoTo Ex

On Error GoTo Ex

pt.ManualUpdate = True
Application.EnableEvents = False
Application.ScreenUpdating = False

Dim Field As PivotField
Set Field = pt.PivotFields(FieldName)
Field.ClearAllFilters
Field.EnableItemSelection = False
SelectPivotItem Field, rng.Text
pt.RefreshTable

Ex:
pt.ManualUpdate = False
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub


Public Sub UpdatePivotFieldFromRangeA(RangeName As String, FieldName As String, _
PivotTableName1 As String)

Dim rng1 As Range
Set rng1 = Application.Range(RangeName)

Dim pt1 As PivotTable
Dim Sheet1 As Worksheet
For Each Sheet1 In Application.ActiveWorkbook.Worksheets
On Error Resume Next
Set pt1 = Sheet.PivotTables(PivotTableName1)
Next
If pt1 Is Nothing Then GoTo Ex

On Error GoTo Ex

pt1.ManualUpdate = True
Application.EnableEvents = False
Application.ScreenUpdating = False

Dim Field1 As PivotField
Set Field1 = pt.PivotFields(FieldName)
Field1.ClearAllFilters
Field1.EnableItemSelection = False
SelectPivotItem Field1, rng1.Text
pt1.RefreshTable

Ex:
pt1.ManualUpdate = False
Application.EnableEvents = True
Application.ScreenUpdating = True

End Sub

Public Sub SelectPivotItem(Field As PivotField, ItemName As String)
Dim Item As PivotItem
For Each Item In Field.PivotItems
Item.Visible = (Item.Caption = ItemName)
Next
End Sub

Public Sub SelectPivotItemA(Field1 As PivotField, ItemName As String)
Dim Item1 As PivotItem
For Each Item1 In Field.PivotItems
Item1.Visible = (Item1.Caption = ItemName)
Next
End Sub


Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect(Target, Application.Range(PCPRangeName)) _
Is Nothing Then
UpdatePivotFieldFromRange _
PCPRangeName, PivotFieldName, PivotTableName
End If
End Sub


Private Sub Workbook_SheetChangeA(ByVal Sh As Object, ByVal Target As Range)
If Not Intersect(Target, Application.Range(PCPRangeName)) _
Is Nothing Then
UpdatePivotFieldFromRangeA _
PCPRangeName, PivotFieldName, PivotTableName1
End If
End Sub