Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 420
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search string to search for wild terms in Access database gab1972 Excel Programming 0 January 27th 10 05:37 PM
Problems Loading Large String Array into Array variable ExcelMonkey Excel Programming 6 May 6th 09 11:12 PM
search text string within array Geeban Excel Discussion (Misc queries) 5 September 16th 08 07:34 AM
to search for a string and affect data if it finds the string? Shwaman Excel Worksheet Functions 1 January 11th 06 12:56 AM
search a string withing a string : find / search hangs itarnak[_9_] Excel Programming 4 October 24th 05 03:19 PM


All times are GMT +1. The time now is 03:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"