Return to Snippet

Revision: 61531
at December 20, 2012 02:59 by lolrenx


Initial Code
Option Explicit
Option Compare Text

'UDF
Public Function Range_to_String(tgtRange As Range, Separator As String) As String

If tgtRange Is Nothing Then Exit Function

Dim tCell As Range
For Each tCell In tgtRange.Cells
    Range_to_String = Range_to_String & Separator & tCell
Next tCell

Range_to_String = Right(Range_to_String, Len(Range_to_String) - 1)

End Function

Initial URL


Initial Description
Concatenate all text in cells with defined separator

Initial Title
Range to String

Initial Tags
excel

Initial Language
Visual Basic