PC Review


Reply
Thread Tools Rate Thread

Dynamic data in PivotSelect statement

 
 
mikearelli
Guest
Posts: n/a
 
      28th Dec 2007
I have a table that changes daily that I am creating a pivot table from.
One day may show Item1 Item2 and Item3, but the next day the source data may
only include Item2 and Item3 (no Item1)

I would like to assign certain items to a group, but I never know which item
will be in the source data for that day.

ActiveSheet.PivotTables("PivotTable2").PivotSelect _
"Item["'Item1',"'Item2',"'Item3'"] 'ALL ITEMS'", xlDataAndLabel, True
Selection.Group

This statement works great if all 3 items are in the source data for today,
but if Item2 is missing from the source data, I get an error and the group
isn't created.

How can I trap for the error and bypass?
 
Reply With Quote
 
 
 
 
mikearelli
Guest
Posts: n/a
 
      2nd Jan 2008
No Suggestions?

"mikearelli" wrote:

> I have a table that changes daily that I am creating a pivot table from.
> One day may show Item1 Item2 and Item3, but the next day the source data may
> only include Item2 and Item3 (no Item1)
>
> I would like to assign certain items to a group, but I never know which item
> will be in the source data for that day.
>
> ActiveSheet.PivotTables("PivotTable2").PivotSelect _
> "Item["'Item1',"'Item2',"'Item3'"] 'ALL ITEMS'", xlDataAndLabel, True
> Selection.Group
>
> This statement works great if all 3 items are in the source data for today,
> but if Item2 is missing from the source data, I get an error and the group
> isn't created.
>
> How can I trap for the error and bypass?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Tables: Alternative to PivotSelect? Paul Martin Microsoft Excel Programming 1 12th Oct 2008 08:51 AM
Using PivotSelect method to find the top of a range =?Utf-8?B?R2VvZmY=?= Microsoft Excel Programming 0 12th Jul 2007 02:32 AM
pivot tables: pivotselect with a very large table jan.marien@gmail.com Microsoft Excel Programming 0 15th Mar 2007 04:14 PM
PivotSelect =?Utf-8?B?TUN5bg==?= Microsoft Excel Programming 1 8th Mar 2006 02:46 AM
Pivottable Pivotselect string mo_in_france Microsoft Excel Programming 2 15th Apr 2005 09:25 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:17 PM.