I just can't get this one, though i'm sure its an easy answer.

If you have a string like this,

string = 1,a|2,b|3,c|4,c

I want to extract (1 and a) and (2 and b) etc.. which is fine, i can use the split function twice in a for loop, but i can't work out how to set the max limit of the loop, for example

Dim firstsplit() as string

firstsplit = split(string,"|")

for i = 0 to max

msgbox(firstsplit(i))

next i

How do i define 'max' ? . If it goes past the length of the string i get an, 'out of subscript error' .