This function below gives you the ability to split a string and return a value from it's split array.
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
Public Function SplitString(value As String, delimiter As String, arrayVal As Integer) As String | |
SplitString = Split(value, delimiter)(arrayVal) | |
End Function |
You can use it like this....
hello, billy | =SplitString(A2, ",", 1) |
Which will return " billy"
Really, to make it a little more robust you may want to check the length of the array created from the split and make sure that the array value you are trying to get is available given the length.
0 comments:
Post a Comment