Concatenate cells in column until second blank

hashasu

New Member
Joined
Mar 26, 2018
Messages
4
Hello!

I am working on a similar project in this thread: https://www.mrexcel.com/forum/excel...catenate-cells-column-until-blank-cell-2.html

However, I need to loop it once so that the process only completes on the second blank. For example my current data looks like this:

kdxkVS

IMG

qdunQ4A
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
For clarification, column one is current data, column two is desired outcome (except I have to apply this formatting to thousands of rows in one column)
 
Upvote 0
Hi & welcome to MrExcel.
How about
Code:
Sub JoinData()

   Dim i As Long
   Dim Ar As Areas
   
   Set Ar = Range("A1", Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
   
   For i = 1 To Ar.Count Step 2
      Range("B" & i).Value = Ar(i) & Chr(10) & Join(Application.Transpose(Ar(i + 1)), Chr(10))
   Next i
End Sub
 
Upvote 0
Thank you!

It's very close, however the current output is being placed every other row, instead of preserving the row the name is on.

For example in the original image, Jane Doe's information is appearing in row 3 instead of row 7.
 
Upvote 0
Ok, how about
Code:
Sub JoinData()

   Dim i As Long
   Dim Ar As Areas
   
   Set Ar = Range("A1", Range("A" & Rows.Count).End(xlUp)).SpecialCells(xlConstants).Areas
   
   For i = 1 To Ar.Count Step 2
      Ar(i).Offset(, 1).Value = Ar(i) & Chr(10) & Join(Application.Transpose(Ar(i + 1)), Chr(10))
   Next i
End Sub
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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
Back
Top