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 fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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,215,500
Messages
6,125,166
Members
449,210
Latest member
grifaz

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