Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Run Time error 428 Help

  1. #1
    Board Regular
    Join Date
    Jul 2008
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Run Time error 428 Help

    I get an error here:

    Code:
    For Each pi In Worksheets("Pivot").PivotTables("pivottable1").PivotFields("Name of Person")
    Please help

    Code:
    Sub macro_214431()
    
    Dim pt As PivotTables
    Dim pi As PivotItems
    Dim pf As PivotFields
    
    Worksheets("Pivot").PivotTables("pivottable1").ManualUpdate = True
    
         With Worksheets("Pivot").PivotTables("pivottable1").PivotFields("name of Person")
             For Each pi In Worksheets("Pivot").PivotTables("pivottable1").PivotFields("Name of Person")
                If pi(i).Visible = True Then
                    ActiveSheet.Rows("1:2").Insert Shift:=xlDown
                    Cells(1, 1).Value = "Name:" & "," & pi(i)
                    Cells(1, 1).FontSize = 13
                    Cells(1, 1).Font.Bold = True
                    Range("A1:d1").HorizontalAlignment = xlCenterAcrossSelection
                    .PrintTitleRows = "$1:$6"
                    
                    End If
    
                    Next pi
    
    End With

  2. #2
    Board Regular
    Join Date
    Jul 2008
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run Time error 428 Help

    bump

  3. #3
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling, Scotland
    Posts
    74,883
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Run Time error 428 Help

    Please tell us what the error message is and what you are trying to do.
    If posting code please use code tags.

  4. #4
    Board Regular
    Join Date
    Jul 2008
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run Time error 428 Help

    Quote Originally Posted by Norie View Post
    Please tell us what the error message is and what you are trying to do.

    I get a runtime 428 error: Object does not support this property of method

    I am trying to take the selected report filter in the Name of Person field to appear as the title ont he first cell in a1. So if someone chooses bob, christina, then their names would appear on top.

  5. #5
    Board Regular Norie's Avatar
    Join Date
    Apr 2004
    Location
    Stirling, Scotland
    Posts
    74,883
    Post Thanks / Like
    Mentioned
    57 Post(s)
    Tagged
    5 Thread(s)

    Default Re: Run Time error 428 Help

    I think you might want to lose the ("Name of person") part.

    Or add something to it, Pivotfields(Item) returns a PivotField object which has various properties.
    If posting code please use code tags.

  6. #6
    Board Regular
    Join Date
    Jul 2008
    Posts
    202
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Run Time error 428 Help

    Quote Originally Posted by Norie View Post
    I think you might want to lose the ("Name of person") part.

    Or add something to it, Pivotfields(Item) returns a PivotField object which has various properties.

    still the same error, but thank you

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •