Answers for "excel vba concatenate range"

VBA
0

excel vba concatenate range

Public Function ConcatenateRange(pRange As Range, Optional pDelimiter As String = " ") As String
    ConcatenateRange = Join(WorksheetFunction.Transpose(pRange.Value), pDelimiter)
End Function

Sub TestMe()
    Dim r As Range
    Set r = ThisWorkbook.Worksheets(1).Range("A1:A10")
    MsgBox ConcatenateRange(r)
End Sub
Posted by: Guest on January-20-2021

Code answers related to "VBA"

Browse Popular Code Answers by Language