Concatenating and transposing a row of numbers
Try this macro:
Put this required cell;
=onelist(A1:A100) .
... set range as required
Function onelist(ByRef rng As range) as string
bStr = ""
For Each cell In rng
bStr = bStr & Trim(Str(cell.Value)) & ","
Next
onelist = Left(bStr, Len(bStr) - 1)
End Function
"Colin Hayes" wrote:
Hi All
Hope someone can help.
I have a column of numbers going down the sheet in column A.
I need to concatenate all the numbers in each cell in the column and
separate each by a comma. This would then be displayed as a long list
all in cell B1.
I've been playing around for ages to do this - can someone put me out of
my misery?
Best Wishes
|