I have a complex scorecard that I update monthly in Excel. For each datastream I have pivot tables generated from the data model. The scorecard is pretty dynamic and updates each cell based on row (month) and column (program) values. If I let Excel build the specific code I get the following which works:
=GETPIVOTDATA("[Measures].[PercentWSubstant]",IU_DDPivots!$A$5,"[Append3_Comp].[CountyOrIU]","[Append3_Comp].[CountyOrIU].&[County]","[Append3_Comp].[MonthApprovd]","[Append3_Comp].[MonthApprovd].&[10]")
I need to generalize the month approved portion so that it pulls from the second column of the worksheet. I searched around and found ways to reference a cell specifically, e.g.,
=GETPIVOTDATA("[Measures].[PercentWSubstant]",IU_DDPivots!$A$5,"[Append3_Comp].[CountyOrIU]","[Append3_Comp].[CountyOrIU].&[County]","[Append3_Comp].[MonthApprovd]","[Append3_Comp].[MonthApprovd].&["&MONTH(B27)&"]")
My ultimate goal is to replace that hard reference to B27 with a generalized RC2 reference so it works in whatever line the current cell occurs in. E.g.,
=GETPIVOTDATA("[Measures].[PercentWSubstant]",IU_DDPivots!$A$5,"[Append3_Comp].[CountyOrIU]","[Append3_Comp].[CountyOrIU].&[County]","[Append3_Comp].[MonthApprovd]","[Append3_Comp].[MonthApprovd].&["&MONTH('ScorecardData'!RC2)&"]")
I think I'm close but no matter what I do I get an Application Defined or Object Defined error when I run it.
Any help would be very much appreciated!