Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search array for string
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Search array for string
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. On 07/05/2010 05:51, navin wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search string to search for wild terms in Access database | Excel Programming | |||
Problems Loading Large String Array into Array variable | Excel Programming | |||
search text string within array | Excel Discussion (Misc queries) | |||
to search for a string and affect data if it finds the string? | Excel Worksheet Functions | |||
search a string withing a string : find / search hangs | Excel Programming |