Microsoft Office Tutorials and References
In Depth Information
Returning a worksheet name
The EXTRACTELEMENT function uses three arguments:
h Txt: The text string from which you’re extracting (can be a literal string or a cell
reference)
h An integer that represents the element to extract n:
h Separator: A single character used as the separator
Here’s the VBA code for the EXTRACTELEMENT function:
Function EXTRACTELEMENT(Txt, n, Separator) As String
‘ Returns the nth element of a text string, where the
‘ elements are separated by a specified separator character
Dim AllElements As Variant
AllElements = Split(Txt, Separator)
EXTRACTELEMENT = AllElements(n - 1)
End Function
 
Search JabSto ::




Custom Search