Programming Reference Manual
 
Syntax
 
ItemCount(text$ [,delimiters$])
 
Description
Returns an Integer containing the number of items in the specified delimited text.
 
Items are substrings of a delimited text string. Items, by default, are separated by commas and/or end-of-lines. This can be changed by specifying different delimiters in the delimiters$ parameter. For example, to parse items using a backslash:
           n = ItemCount(text$,"\")
 
Parameter
Description
text$
String containing the text from which a range of items is 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 then
'counts the number of items in each. The counts are
'displayed 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/16/17/18/19"
l1% = ItemCount(ilist$)
l2% = ItemCount(slist$,"/")
msg = "The first lists contains: " & l1% & _
" items." & vbCrLf
msg = msg & "The second list contains: " & _
l2% & " items."
MsgBox msg
End Sub