Confidentjohn
Board Regular
- Joined
- Mar 3, 2009
- Messages
- 73
Hi
I have a macro setup in Excel that filters a data set.
The filter part looks like
Some of the data sets i have might not have some of the later fields.
Is there a way to program the filter to try the above, then if an error try
again if that errors, try
On until the last item remains
Hope someone can help
Cheers
John
I have a macro setup in Excel that filters a data set.
The filter part looks like
Code:
ActiveSheet.PivotTables("cohortCLVTwoYear").CubeFields(17).EnableMultiplePageItems = _
True
ActiveSheet.PivotTables("cohortCLVTwoYear").PivotFields( _
"[data1].[CUST_COMBINEDmonthsFromOrder].[CUST_COMBINEDmonthsFromOrder]"). _
VisibleItemsList = Array( _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[01-03_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[04-06_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[07-09_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[10-12_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[13-18_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[19-24_Months]")
Some of the data sets i have might not have some of the later fields.
Is there a way to program the filter to try the above, then if an error try
Code:
ActiveSheet.PivotTables("cohortCLVTwoYear").CubeFields(17).EnableMultiplePageItems = _
True
ActiveSheet.PivotTables("cohortCLVTwoYear").PivotFields( _
"[data1].[CUST_COMBINEDmonthsFromOrder].[CUST_COMBINEDmonthsFromOrder]"). _
VisibleItemsList = Array( _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[01-03_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[04-06_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[07-09_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[10-12_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[13-18_Months]")
again if that errors, try
Code:
ActiveSheet.PivotTables("cohortCLVTwoYear").CubeFields(17).EnableMultiplePageItems = _
True
ActiveSheet.PivotTables("cohortCLVTwoYear").PivotFields( _
"[data1].[CUST_COMBINEDmonthsFromOrder].[CUST_COMBINEDmonthsFromOrder]"). _
VisibleItemsList = Array( _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[01-03_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[04-06_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[07-09_Months]", _
"[data1].[CUST_COMBINEDmonthsFromOrder].&[10-12_Months]")
On until the last item remains
Hope someone can help
Cheers
John