Concatenate/merge all data in an Excel row (or column) into a single string.

PHOTO EMBED

Thu Mar 04 2021 16:49:17 GMT+0000 (UTC)

Saved by @mhollberg

Function XL2L_rangeConcat(r_Range As Range, Optional s_separator As String) As String
'Concatenate all values in a range
'Set up as a User-Defined Function (Google "UDF") in your Excel workbooks - can execute within
'cells via function =XL2L_rangeConcat(A1:A10, " ")
Dim r_cell As Range

For Each r_cell In r_Range
    XL2L_rangeConcat = XL2L_rangeConcat & r_cell.Value & s_separator
Next r_cell
End Function    'XL2L_rangeConcat
content_copyCOPY

Create as a UDF (User-Defined Function) in Excel. Use to join individual records into a single string. Example: FNAME Middle LastName becomes -> "FNAME Middle LastName"