I have a workbook with cells that have linebreaks (entered via ALT + ENTER).
I have to separate them into individual rows. All the cells are in column A.
Each line in the cell has a bullet point (eg. "* ") up front, which could serve as a beacon to break the line at this point.
There is no need of code for this, lets make it simple.
Follow the bellow steps.
Select the data-set you want to split -> Go to Data Tab -> Select "Text to columns" -> from this pop-up select "Delimited" -> Select which delimiter is separating your texts -> Select the destination cell -> Click "OK"
Try This.
Regards, Ashwin
Edit from Markus: For the newline as delimiter use "Ctr-J"
Sub extract()
'Query extract data in cell B divided by ALT+Enter, Comma space 'Mandatory to create in front Sheet1, Sheet2, and Sheet3 'ATTENTION! if field B is empty return no data!! Manually add column A (with empty column B)if needed!! 'manually remove empty cell in results (Sheet2) 'before START Query remove duplicate from input data!! 'Doesn't work with full stop 'When finished Msg Done will be display
Dim c As Long, r As Range, I As Long, d As Long, Temp() As String d = 0 For Each r In Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row) ' Change this to suit your range.. c = 2 Temp = Split((r.Value), Chr(10)) For i = LBound(Temp) To UBound(Temp)
You can use split with Chr(10) or VbLf
No you have array to place each row to different cell
If you select the cell and run the macro you would get what you want on the next column like this:
This will work on one row only after selecting it (but should get you started):