How to Concatenate Multiple Rows with Conditions?

SiddharthB

New Member
Joined
Jun 11, 2018
Messages
1
Code No.Sr. NoCustomerDescriptionListIF (code)IF (sr. no)sumTextjoin (Description)
1
1ABCsentencex1121
22EFHsentencex1122
3sentencex1012
43PQRsentencex1123
5sentencex1013
6sentencex1013
74SYZsentencex1124
x0004
85LMOsentencex1125

<tbody>
</tbody>

I need to concatenate (with a line break) the multiple rows (in description column) for each customer having a serial no. so that in the Textjoin colum, there is only one row for each customer and that row has all the sentences (with a line break) in the description column pertaining to each customer.

Is this possible? Help! Thank you
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
53,012
Office Version
  1. 365
Platform
  1. Windows
Hi & welcome to the board.
How about
Code:
Sub ConcatDel()
   Dim Rng As Range
   
   For Each Rng In Range("C:C").SpecialCells(xlBlanks).Areas
      Rng.Offset(-1, 7).Resize(1, 1).Value = Join(Application.Transpose(Rng.Offset(-1, 1).Resize(Rng.Count + 1)), Chr(10))
   Next Rng
   Range("C:C").SpecialCells(xlBlanks).EntireRow.Delete
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,737
Messages
5,597,826
Members
414,180
Latest member
Sir Khaya

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top