Invalid Procedure Call or Argument? - Programmers Heaven

Howdy, Stranger!

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

Categories

Invalid Procedure Call or Argument?

ziriuszirius Posts: 2Member
********************************************************
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
Else
[color=Blue]Target.Parent.PivotTables(lngPTIndex).PivotFields("Name").CurrentPage = strCurrentPage[/color]
End If
Next
Application.EnableEvents = True

End Sub
*******************************************************

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