+ Reply to Thread
Results 1 to 3 of 3

PivotTable Pivot Fields CurrentPage

  1. #1

    PivotTable Pivot Fields CurrentPage

    Hope someone can help me with the following problems.

    Two problems I'm having with PivotFields.CurrentPage:

    1 - User types a value in cell and this value is set to a certain
    PivotField using the CurrentPage property. Problem is that the value
    actually replaces the one already set on the PivotField. Ex.: If a have
    a value of 100 in the PivotField and change it via VBA using the
    CurrentPage to a value of 120 and this value does not exists in the
    PivotField list it replaces de 100 label to 120.

    2 - To minimize the problem above, is it possible to verify if a
    certain value exists in the PivotField list before setting it with the
    CurrentPage property?

    TIA

    LCDM


  2. #2
    Registered User
    Join Date
    09-27-2004
    Posts
    1

    Thumbs up Fix: PivotTable Pivot Fields CurrentPage

    Hello Guys

    This is my first reply of tons to come, I hope...

    Well first of all I like to make an statment, I hate MS Excel.

    Second, LCDM, I've come to a solution for a problem related to yours:

    First yes, there is a way to search for a value in the pTable before inserting a 'new-bad' item, please feel free to use it anyway you like
    (NOTE: you can ignore/remove the AllFlag part, I won't explain/modify further)

    Please Login or Register  to view this content.
    Then, the best part of the PivotTable is when it comes to update any of its items, is a pane in the glass.

    I tried updating directly (per Macro Recorder instructions) the value of the
    Please Login or Register  to view this content.
    I also tried CurrentPageName and others (like PivotItem) without success, just 1004-like errors and Unable to get PivotField or PivotTable or CurrentPage and all that. I even get a funny one with a 8080808-like error...

    Well to the point, My pivottable is as follows:
    Please Login or Register  to view this content.
    Ok, while trying to set the pages to different values using CurrentPage excel crashed. Then I tried Updating the Cell (Range) where my Page value was reflected, lets say X9 for month and X10 for id. This worked find directly in spreadsheet (it updated all data, and no data duplication in PT), however while doing in VBA the same using somthing like:

    Please Login or Register  to view this content.
    The id value worked just find, but not so for the month part. No error showed up, just the cell X9 did not want to change, so I tried, just for this PageField the following:

    Please Login or Register  to view this content.
    where:
    Please Login or Register  to view this content.
    and this, worked just (Y),

    Ok, that's it, Another advise I can give you is to format your assigned value correctly before assigning it to the PivotField or PageField.
    Last edited by VBA Noob; 10-15-2008 at 02:25 AM. Reason: Added code tags

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Omar,

    Thanks for posting you're answer. As per our forum rules below I've added you're code tags for you but you must add them yourself next time

    Thanks

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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