concatenate column list to textbox with comma delimiter

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!
jcgrooveAsked:
Who is Participating?
 
Saqib Husain, SyedEngineerCommented:
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
0
 
jcgrooveAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.