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)
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
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:
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:
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:
where:
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.
Bookmarks