How To Concatenate Multiple Excel Cells In A Column Into One Cell Using VBA.

preview_player
Показать описание
In this video, we look at how to concatenate multiple cells in a column into a single cell. This is particularly useful when you want to combine multiple sentences into a single paragraph and then copy it to a word document.

The code is as follows:

Sub Concatenate()
Dim wb As Workbook
Set wb = ThisWorkbook

Dim ws As Worksheet
Set ws = wb.Sheets("Sheet1")

Dim sentence As String

For i = 1 To 4
sentence = sentence & " " & ws.Cells(i, 1)
Next i

ws.Cells(1, 2) = Trim(sentence)
End Sub
Рекомендации по теме
Комментарии
Автор

Thanks very useful, , this was I am searching very long in vba
... Finally I got your video understand.
It's very useful in my office

chandruchandru-uqeg
Автор

Thank you for the code it is usefull i want to know if i can edit the code in away that the text be writen each word in a seprate ligne

noemannoeman