Search array for string

  • Thread starter Thread starter navin
  • Start date Start date
N

navin

Hi all,

Is there a function in vba to search occurrence of a letter and return
its index?
I need to find the first and nth index of a character in an array.

Array: (****+++++++**)

I need to find out the first occurrence of + and last occurrence of +
in the array. I got the result by looping thru the array but was
hoping
to find out a smaller function to achieve this.

Thanks for the help.

Navin
 
Hi all,

Is there a function in vba to search occurrence of a letter and return
its index?
I need to find the first and nth index of a character in an array.

Array: (****+++++++**)

I need to find out the first occurrence of + and last occurrence of +
in the array. I got the result by looping thru the array but was
hoping
to find out a smaller function to achieve this.

Thanks for the help.

Navin

I've created an excel add-in that has a couple of functions in it that
might help with what you're after:-

http://2toria.com/downloads/

HTH
Matt
http://2toria.com
http://teachr.blogspot.com
 
I've created an excel add-in that has a couple of functions in it that
might help with what you're after:-

http://2toria.com/downloads/

HTH
Matthttp://2toria.comhttp://teachr.blogspot.com


Hi,

thanks for the reply. I actually wrote a function to find out the
result
but hoping to find some built in function to do this search and get
the index. Somehing like instr.
 
If you're really looking through a string -- not an array, you could use VBA's
Instr to find the first position.

And if you're using xl2k or higher, you could use RevInStr to find the last
position.
 
Back
Top