Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I need a help on the following macro.
I am using a FIELD which has the following values like
Region,
Year,
Department
There are around 50 dimensions like this. User will be selecting the required dimensions for a crosstab report themselves. So I want the selected values in the Field to be sent to a macro and then the dimensions have to added to the Pivot table.
I have written the following script. but I am unable to make the Field selections to be passed to an array variable and then add it to the Pivot table using a loop. Need your help pls.
I am not able to pass the strVariable to the Array function.Getting error in the msgbox function. If this works i wil then add the loop to add the fields one by one below.
SUB add_dimension
Set chart =ActiveDocument.GetSheetObject("CH07")
SET vb=ActiveDocument.Variables("V_dim_fields")
strVariable= vb.GetContent.String
a=Array(strVariable)
msgbox(a(1))
a.chart.AddDimension "COUNTRY"
'Adding the single dimension "Country" works fine.
End Sub
Thanks,
Venu
If you're using QV11 I'd use conditional expressions instead like in this example. But if you feel you need to use a macro to do this look at the example here.