Is there a way to dynamically concatenate rows into a single cell using VBA code?
I have a sample where the column highlighted in yellow would be the desired outcome.
Is there a way to dynamically concatenate rows into a single cell using VBA code?
I have a sample where the column highlighted in yellow would be the desired outcome.
You can loop through the range areas.
![]()
Please Login or Register to view this content.
Or try:
PHP Code:
Public Sub MyConcat()
Dim lastRow As Long
Dim i As Long
Dim temp As String
lastRow = Range("B" & Rows.Count).End(xlUp).Row
For i = lastRow To 2 Step -1
temp = Range("B" & i).Value & temp
If Range("A" & i).Value <> "" Then
Range("C" & i).Value = temp
temp = ""
End If
Next i
End Sub
Hi,
What about
![]()
Please Login or Register to view this content.
Last edited by mohadin; 12-20-2020 at 08:39 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks