You are on page 1of 1

Sub JoinAndMerge() 'joins all the content in thisRange using optional delim 'and puts the resulting text

in top most cell 'then merges all cells Dim outputText As String Dim inputRange As Variant Const delim = " " On Error Resume Next For Each cell In Selection outputText = outputText & cell.Value & delim Next cell With Selection .Clear .Cells(1).Value = outputText .Merge .HorizontalAlignment = xlGeneral .VerticalAlignment = xlCenter .WrapText = True End With End Sub

You might also like