Forum Discussion
Delimiter for Separate Line Breaks in Cell not Working
- Nov 01, 2021
HansVogelaar So I found a way to get it to work. All I did was edit the information that appears in the formula bar- like delete a word and then retype it-and somehow the text to column options works just fine.
Sub Delimit()
'splits Text active cell using ALT+10 char as separator
Dim splitVals As Variant
Dim totalVals As Long
Dim i As Integer
For i = 1 To 1000
splitVals = Split(ActiveCell.Value, Chr(10))
totalVals = UBound(splitVals)
Range(Cells(ActiveCell.Row, ActiveCell.Column + 1), Cells(ActiveCell.Row, ActiveCell.Column + 1 + totalVals)).Value = splitVals
ActiveCell.Offset(1, 0).Activate
Next i
End Sub
Here is a shorter macro. Select the cells with multiple lines (in a column) before running the macro.
Sub SplitLines()
Selection.TextToColumns DataType:=xlDelimited, Other:=True, OtherChar:=vbLf
End Sub
- mrt1012Nov 01, 2021Copper Contributor
HansVogelaar So I found a way to get it to work. All I did was edit the information that appears in the formula bar- like delete a word and then retype it-and somehow the text to column options works just fine.
- sciclunamFeb 27, 2022Copper Contributor
Hi all. I have the exact same problem where the text to columns on multi line cells only works if I edit something in the cell, even if I just double click on the cell to enter edit mode is enough. The problem is that I have thousands of records so I can't double click on all. I tried find/replace to edit something but to no avail. Any idea pls? Thanks a lot.