Finding

Discussion in 'Code Snippets and Tutorials' started by NHStephen, Apr 18, 2007.

  1. NHStephen

    NHStephen Level IV

    Joined:
    Jan 2, 2007
    Messages:
    1,114
    Likes Received:
    9
    Find stuf on a page

    Like how many of stephen on a page


    i have one but it doesnt work anyone have one that kind of works
     
  2. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    finding a string in html code, or finding how many of a certain string appears in a html document?
     
  3. NHStephen

    NHStephen Level IV

    Joined:
    Jan 2, 2007
    Messages:
    1,114
    Likes Received:
    9
    yes how many are in the doc like if there 25 stephen on the page and i want it to find stephen and it would show up as 25 in the text box
     
  4. Billy

    Billy Level IV

    Joined:
    Feb 21, 2007
    Messages:
    1,856
    Likes Received:
    39
    how many stephens on a web page or in a text box?
     
  5. Pankirk

    Pankirk Level III

    Joined:
    Nov 12, 2006
    Messages:
    652
    Likes Received:
    28
    Location:
    America
    Uhh you could parse however many times stephen shows up on the screen and add it to a textbox. Then whatever your parsing, it could be like "stephen" then under it put "text1.text=+1" and make sure you put a number in the text1 box that you want to add to. Hopefully that will help?
     
  6. ricky92

    ricky92 Administrator
    Staff Member

    Joined:
    Nov 10, 2006
    Messages:
    1,866
    Likes Received:
    67
    Here's a function I made, it works now!!!
    Code (Text):
    1. Public Function TimesInString(strSource As String, strText As String, Optional Start = 1) As Long
    2. Dim lngCurrent, temp As Long
    3. lngCurrent = Start
    4. Do Until lngCurrent = 0
    5. TimesInString = TimesInString + 1
    6. lngCurrent = InStr(lngCurrent + 1, strSource, strText)
    7. Loop
    8. End Function
     
  7. NHStephen

    NHStephen Level IV

    Joined:
    Jan 2, 2007
    Messages:
    1,114
    Likes Received:
    9
    woah ricky is da beast



    nvm it doesnt work