+ Reply to Thread
Results 1 to 2 of 2

Error 1004 Unable to set the CurrentPage property of the PivotField class

  1. #1
    Registered User
    Join Date
    08-24-2020
    Location
    Australia
    MS-Off Ver
    365 proPlus
    Posts
    1

    Error 1004 Unable to set the CurrentPage property of the PivotField class

    Hello,

    I am trying to change Filter in Multiple Pivot Tables based on a Cell Value. However, I keep getting the error Error 1004 Unable to set the CurrentPage property of the PivotField class. I would really appreciate if anyone knows how I can fix it. Here is my code, I also attached an example. Thank you so much

    Private Sub CommandButton1_Click()

    Dim a As String
    Dim pt As PivotTable

    ThisWorkbook.Worksheets("Sheet3").Activate

    a = Worksheets("Sheet3").Cells(2, 3).Value

    For Each pt In ActiveSheet.PivotTables

    With pt.PivotFields("Order")

    .ClearAllFilters

    .CurrentPage = a

    End With

    Next


    End Sub
    Attached Files Attached Files

  2. #2
    Forum Expert nankw83's Avatar
    Join Date
    08-31-2015
    Location
    Kuwait
    MS-Off Ver
    365
    Posts
    1,712

    Re: Error 1004 Unable to set the CurrentPage property of the PivotField class

    Hi Zadira & welcome to the forum

    Try the revised below code ...
    Please Login or Register  to view this content.
    PS: Please edit your post, select the code then click # button form the menu to insert code tags for you
    If I was able to help, you can thank me by clicking the * Add Reputation under my user name

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error msg : unable to get the PivotItems property of the PivotField class
    By Kim75 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-12-2015, 03:56 PM
  2. Getting "Unable to set CurrentPage property of PivotField class" error
    By jsweez24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2015, 03:03 PM
  3. RUN –TIME ERROR ‘1004’: Unable to set the currentpage property of the pivotfield class
    By saudi_red_neck in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2014, 02:54 AM
  4. runtime 1004 error 'Unable to get the Pivotitems property of the Pivotfield class'
    By DavidBW in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2012, 10:36 AM
  5. Unable to set the currentpage property of the pivotfield class
    By adoepker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-09-2011, 06:23 PM
  6. Unable to set the CurrentPage Property of the PivotField Class
    By Murali6688 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-18-2011, 12:16 PM
  7. Unable to set the CurrentPage Property of the PivotField Class
    By SDruley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-09-2011, 01:39 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1