We help IT Professionals succeed at work.

concatenate column list to textbox with comma delimiter

jcgroove
jcgroove asked
on
I have a column of values (numbers) that start at G4 and could go down the column to an unpredictable length. I would like to join the cell values with a comma delimiter in a userform text box (GainTextBox) on its initialize event.
Any help would be appreciated!
Comment
Watch Question

Try

Dim cel As Range
Me.GainTextBox = ""
For Each cel In Range("G4:G" & Range("G4").End(xlDown).Row)
    Me.GainTextBox = Me.GainTextBox & IIf(Me.GainTextBox = "", "", ",") & cel
Next cel

Author

Commented:
Thanks!