Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Invalid Procedure Call or Argument?

ziriuszirius Member Posts: 2
Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)

Dim strPTName As String
Dim lngPTIndex As Long
Dim strCurrentPage As String

strPTName = Target.Name
strCurrentPage = Target.PivotFields("Name").CurrentPage

Application.EnableEvents = False

For lngPTIndex = 1 To Target.Parent.PivotTables.Count
If Target.Parent.PivotTables(lngPTIndex).Name = strPTName Then
[color=Blue]Target.Parent.PivotTables(lngPTIndex).PivotFields("Name").CurrentPage = strCurrentPage[/color]
End If
Application.EnableEvents = True

End Sub

The debugger in Excel points to the blue section
Sign In or Register to comment.