Macro to Join Text in Excel


Join Text present in different cells of a Column


Sub JoinStringsInColumn()
Dim XLnCAD As Range, Sonder As Range, XNC As String
Set XLnCAD = Selection
For Each Sonder In XLnCAD
XNC = XNC & " " & Sonder
Next
ActiveCell.Offset(0, 1).Select
Selection.Value = XNC
Selection.Font.Bold = True
End Sub

Join Text in present in different cells of a Row


Sub JoinStringsInRow()
Dim XLnCAD As Range, Sonder As Range, XNC As String
Set XLnCAD = Selection
For Each Sonder In XLnCAD
XNC = XNC & " " & Sonder
Next
ActiveCell.Offset(1, 0).Select
Selection.Value = XNC
Selection.Font.Bold = True
End Sub

Leave a Reply

Your email address will not be published.Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.