+ Reply to Thread
Results 1 to 2 of 2

Prevent Setting .CurrentPage to value that does not exist in PivotField.

  1. #1
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Prevent Setting .CurrentPage to value that does not exist in PivotField.

    Hello,

    I have the following VBA to set the .CurrentPage (of the PivotTable Filter "Item Code") to a variable.

    Please Login or Register  to view this content.
    If ItemCodeVariable does not equal something that already exists in the the field "Item Code", I want it to fail and return a message. Currently, it will just set the page equal to the variable (effectively doing nothing except being confusing).

    For example, "Item Code" would only be loaded with "100", "200","300","400". If I set ItemCodeVariable = 500, it should not work. (In reality, I have thousands of Item Codes).

    Any help would be greatly appreciated.

    Thank You,

    EnigmaMatter
    Thank You,

    EnigmaMatter

  2. #2
    Forum Contributor
    Join Date
    02-04-2014
    Location
    Florida, United States
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    366

    Re: Prevent Setting .CurrentPage to value that does not exist in PivotField.

    Rgonzo1971 gave the following solution:

    Please Login or Register  to view this content.
    Rory gave the following solution:

    Please Login or Register  to view this content.

+ 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. 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
  2. Won't let me set CurrentPage property of PivotField
    By duncandhu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-06-2013, 10:15 AM
  3. 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
  4. 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
  5. 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

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