Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Dynamic data in PivotSelect statement

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Dynamic data in PivotSelect statement

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using PivotSelect method to find the top of a range Geoff Excel Programming 0 July 12th 07 02:32 AM
pivot tables: pivotselect with a very large table [email protected] Excel Programming 0 March 15th 07 04:14 PM
Dynamic Conditional Statement gti_jobert[_97_] Excel Programming 3 May 8th 06 04:13 PM
PivotSelect MCyn Excel Programming 1 March 8th 06 02:46 AM
Pivottable Pivotselect string mo_in_france Excel Programming 2 April 15th 05 09:25 AM


All times are GMT +1. The time now is 06:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"