Splitting String at Blank Empty Row

ESACAWIP

New Member
Joined
Nov 9, 2020
Messages
21
Office Version
  1. 365
Platform
  1. Windows
hi, hope all is good

I am given the following, all in a single cell:

aaa
bbb
ccc

ddd
eee
fff

zzz
eee
eee


can someone help with a macro where if I select the entire column, it would split each cell by the blank row into consecutive columns?
aaa ddd zzz
bbb eee eee
ccc fff eee



Much appreciated!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Hard to understand exactly what it is you are looking for here as cannot determine cell orientation. Please provide sample data and mocked up solution in XL2BB
 
Upvote 0
Hard to understand exactly what it is you are looking for here as cannot determine cell orientation. Please provide sample data and mocked up solution in XL2BB
example22.JPG


Sorry i am not sure how that works but here is a screenshot of an example. I have large amounts of columns where data is presented / broken into seperate paragraphs. I would like to split this by each blank row (not line). Is this possible?
 
Upvote 0
Hi,

Is it possible to upload that sample using XL2BB?
So we don't have to Manually Type and recreate your data for testing.

Check my signature for instructions.
 
Upvote 0
Here, I typed in the 1st sample, see if this works for you.
Sorry, I can only offer a formula solution.
Formula copied down and across as far as you need.

Book3.xlsx
ABCDE
245334 Turk Avenue apt 2031 New York, NY 43254 Car: Corvette White Sports Car Height: 5 9 eye: brown45334 Turk Avenue apt 2031 New York, NY 43254Car: Corvette White Sports CarHeight: 5 9 eye: brown 
Sheet907
Cell Formulas
RangeFormula
B2:E2B2=TRIM(MID(SUBSTITUTE($A2,CHAR(10)&CHAR(10),REPT(" ",LEN($A2))),COLUMNS($B2:B2)*LEN($A2)-LEN($A2)+1,LEN($A2)))
 
Upvote 0
Macro to extraact comments in column A.xlsm
ABCD
1DataOutputOutputOutput
2 45334 Turk Avenue Apt 2031 New York, NY 43254 Car: BMW 3 Series Back Sedan Height 5 3 Eye:Black45334 Turk Avenue Apt 2031 New York, NY 43254Car: BMW 3 Series Back SedanHeight 5 3 Eye:Black
3543544 Mike Street New York, NY 543565 Car: Toyota White Coupe Height: 6 Feet Eye: Green 543544 Mike Street New York, NY 543565Car: Toyota White CoupeHeight: 6 Feet Eye: Green
Sheet3
 
Upvote 0
Thank you jtakw! If anyone can help with a VBA code that would be really great since I have some cells with 20+ "paragraphs" but for now, this is more than enough for me to get my work rolling. :)
 
Upvote 0
You're welcome, thanks for the feedback.

Hopefully, someone will come along with a VBA code to do the same.:)
 
Upvote 0
Give this a try...
VBA Code:
Sub SplitOnDoubleLineFeeds()
  Dim R As Long
  Application.ScreenUpdating = False
  For R = 2 To Cells(Rows.Count, "A").End(xlUp).Row
    Cells(R, "B").Resize(, 3) = Split(Cells(R, "A").Value, vbLf & vbLf)
  Next
  Application.ScreenUpdating = True
End Sub
 
Upvote 0
Hi Rick,

I'm not good at VBA at All, so pardon me for asking...
Does this bit Cells(R, "B").Resize(, 3) allows for expanding up to 3 Columns?

Reasons I ask, 1, I don't know
2, OP says he has Strings up to 20 separate substings.
 
Upvote 0

Forum statistics

Threads
1,214,784
Messages
6,121,535
Members
449,037
Latest member
tmmotairi

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