If I have 2 columns, ID and Value, and I make a selection (or selections) on the ID column, then the Concat(Distinct Value, ',') function will give me a list of the associated values in the Value field.
Now, I can't call Concal from a Macro. But what I can do is create a variable, lets call it vValue, which has a value of :
=Concat(Distinct Value, ',')
The "=" causes the Variable to always calculate the value so, if I query the value of the variable then I can get the result - and you can easily query variable values in a Macro.
Does that do what you want?