filmov
tv
How to split text in excel - 7 methods
Показать описание
Flash Fill, Text-to-Columns, Power Query, Formula, Macro, Google sheets, UDF
Separate words into multiple columns
Method 1: Flash Fill 00:00
Method 2: Text-to-Columns 00:39
Method 3: Power Query 01:17
Method 4: Formula 02:40
Method 5: Macro 03:01
Method 6: Google sheets 09:44
Method 7: UDF 10:30
--------------------------------------------------------------------------------------------------------------
=TRIM(MID(SUBSTITUTE($J5," ",REPT(" ",LEN($J5))),(COLUMNS($J4:J4)-1)*LEN($J5)+1,LEN($J5)))
--------------------------------------------------------------------------------------------------------------
Sub splt1()
Dim r As Integer
Dim c As Integer
r = ActiveCell.Row
c = ActiveCell.Column
Selection.TextToColumns Destination:=Cells(r, c + 1), DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, Space:=True
End Sub
--------------------------------------------------------------------------------------------------------------
Function splt(rng As Range, dlim As String, num As Integer)
With Application
splt = .IfError(.Index(Split(rng, dlim), 1, num), "")
End With
End Function
Separate words into multiple columns
Method 1: Flash Fill 00:00
Method 2: Text-to-Columns 00:39
Method 3: Power Query 01:17
Method 4: Formula 02:40
Method 5: Macro 03:01
Method 6: Google sheets 09:44
Method 7: UDF 10:30
--------------------------------------------------------------------------------------------------------------
=TRIM(MID(SUBSTITUTE($J5," ",REPT(" ",LEN($J5))),(COLUMNS($J4:J4)-1)*LEN($J5)+1,LEN($J5)))
--------------------------------------------------------------------------------------------------------------
Sub splt1()
Dim r As Integer
Dim c As Integer
r = ActiveCell.Row
c = ActiveCell.Column
Selection.TextToColumns Destination:=Cells(r, c + 1), DataType:=xlDelimited, _
ConsecutiveDelimiter:=True, Space:=True
End Sub
--------------------------------------------------------------------------------------------------------------
Function splt(rng As Range, dlim As String, num As Integer)
With Application
splt = .IfError(.Index(Split(rng, dlim), 1, num), "")
End With
End Function
Комментарии