OLAP Marco List is Too Big

drewg

Board Regular
Joined
Jul 5, 2010
Messages
67
hi gurus;
i was going to ask how to set a pivot table filter for over 4500 items, but instead of asking that, i went ahead and recorded a macro that almost did what i needed, except not 4500 times!
My Marco generator efforts yieded this;

Sub SetAmSurgProcCodes()
'
' SetAmSurgProcCodes Macro
'
'
ActiveSheet.PivotTables("PivotTable1").PivotFields( _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim]" _
).VisibleItemsList = Array( _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00037]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00065]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00100]")


End Sub

So i went back into SQL and wrote this;
select
'"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&['+
ltrim(rtrim(ProcedureCode)) +
']", '
from dbo.vw_MEDSII_ProcedureCodes_Dim
where procedurecode between '0' and '69999'

which produces output like this, which i can *almost* use

"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[0000]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00000]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[0001]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00031]", _
"[Vw MEDSII Procedure Codes Dim].[Vw MEDSII Procedure Codes Dim].&[00037]", _


My problem is that i get an error in the VBA editor that says i have used too many line continuation characters, and that i need to break it into multiple statements, but i dont know how to do that.

Thanks very much for your help
drew
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top