Last active
November 6, 2017 14:49
-
-
Save longtth/e2076a284aa94a7668321b905e487ae5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' rng: Cell chứa chuỗi cần cắt | |
' c : chuỗi con dùng làm delimiter | |
' n : vị trí chuỗi con cần lấy (bắt đầu từ 0) | |
Function TokenizeAt(rng As Range, c As String, n As Integer) | |
Dim ret As String | |
If (rng.Cells.Count > 1) Then | |
ret = "Only allow 1 cell" | |
End If | |
Dim strArr() As String | |
strArr = Split(rng, c) | |
ret = strArr(n) | |
TokenizeAt = ret | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment