Another UDF might be
Function GetClaimFrom(rng As Range, Optional Position As Long, Optional Delimiter As String)
Dim arr As Variant
If Position = 0 Then Position = 1
If Delimiter = "" Then Delimiter = " "
arr = Split(rng, Delimiter)
If Position > UBound(arr) + 1 Then
GetClaimFrom = ""
Else
GetClaimFrom = arr(Position - 1)
End If
End Function
Or called in VBa
myVar = GetClaimFrom(Range("A2"))
will return the first value
myVar = GetClaimFrom(Range("A2"),2)
Returns the second
myVar = GetClaimFrom(Range("A2"),1,",")
Uses "," as the separator instead of the default " " (Space).
Hope this helps
Bookmarks