Programming Reference Manual
 
Syntax
 
Item$(text$,first,last [,delimiters$])
 
Description
Returns all the items between first and last within the specified formatted text list.
 
Parameter
Description
text$
String containing the text from which a range of items is returned.
first
Integer containing the index of the first item to be returned. If first is greater than the number of items in text$, then a zero-length string is returned.
last
Integer containing the index of the last item to be returned. All of the items between first and last are returned. If last is greater than the number of items in text$, then all items from first to the end of text are returned.
delimiter$
String containing different item delimiters. By default, items are separated by commas and end-of-lines. This can be changed by specifying different delimiters in the delimiters$ parameter.
See Also
Example
 
Sub Main
‘This example creates two delimited lists and
‘extracts a range from each, then displays the
‘result in a dialog box.
 
    ilist$ = “1,2,3,4,5,6,7,8,9,10,11,12,13,14,15”
    slist$ = “1/2/3/4/5/6/7/8/9/10/11/12/13/14/15”
    list1$ = Item$(ilist$,5,12)
    list2$ = Item$(slist$,2,9,”/”)
    MsgBox “The returned lists are: “ & vbCrLf & _
                 list1$ & vbCrLf & list2$
End Sub