VBA: position of substring in a comma-delimited string
Posted on 2009-07-06
I have a comma delimited string like
mystring = "(number1,number2,number3, number4)
or (2343, 7765, 9928, 3354)
I need a function that returns a relative position of a given number inside that string, i.e.
myFunction(mystring, 2343) = 1
what is the simplest way of doing this? In php it would take just two lines of code with explode/implode, but I am not sure what is the closest option in VBA.
Please, advise..... it needs to be a very short solution