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
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