TOP

Automatic splitting of text by the given separator (SPLITUP)

Below you will find a function that will help you split the text into parts based on the specified separator.

To do this, open the editor Visual Basic (Alt+F11), insert a new empty software module (Insert - Module) and copy the text of this function there:

Function SPLITUP(Txt, Delimiter, n) As String
   Dim x As Variant
      x = Split(Txt, Delimiter)
      If n > 0 And n - 1 <= UBound(x) Then
        SPLITUP = x(n - 1)
      Else
        SPLITUP = ""
      End If
End Function

Save and return to Excel. Now in custom functions you can find our SPLITUP() function.

SPLITUP (text; separator; sequence number of the fragment) , where:

Related Articles: