Results 1 to 4 of 4

Thread: [RESOLVED] Search for a second instance of a string

  1. #1

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Resolved [RESOLVED] Search for a second instance of a string

    hi all.

    What im trying to do is search through some html right. There is a certain code before the text that i wish to extract. So what i have done is made it search fro the text that will always be there and then selected the next few characters to get the random text that i need.

    the problem i am having is i do not no how to search through the textbox with the html in it, and then ignore the first instance of it once its already found that one...

    i no this isnt very well explained, ask me if you want me to re-explain

    oh and also, i am using the "instr" call to find what i want...

    thanks

    REMEMBER TO RATE

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Search for a second instance of a string

    This is not what you are looking for but it will guide you for what you are looking for
    Attached Files Attached Files

  3. #3
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Search for a second instance of a string

    Quote Originally Posted by feneck
    ... i am using the "instr" call to find what i want...
    Since you already know how to use it I will just give you some guidance:

    next occurence of the same string can be found using this logic:
    Code:
        pos1 = InStr(1, source_string, search_string)
        Debug.Print InStr(pos1 + 1 + Len(search_string), source_string, search_string)

  4. #4

    Thread Starter
    Lively Member feneck's Avatar
    Join Date
    Mar 2007
    Location
    Australia, Queensland, Gympie
    Posts
    85

    Re: Search for a second instance of a string

    thanks guys... got it

    REMEMBER TO RATE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width