Consulting

Results 1 to 4 of 4

Thread: Solved: search workbook

  1. #1
    VBAX Newbie
    Joined
    Jul 2006
    Location
    Melbourne, Australia
    Posts
    2
    Location

    Solved: search workbook

    I have a series of worksheets with the following format

    Fisrtname,Surname,Landline, cellphone, email
    John Doe 1234567890 1234567890 jdoe@somewhere.com

    I need to creat a search form that lets a user enter firstname or surname or both and it return just the firstname/surname/landline/cellphone in the matching row (or rows if duplicated). If a user enters just the firstname or just the surname it should return firstname/surname/landline/cellphone in the matching row/s Can this be done. I currently have it searching ranges but can only get it to return on one search criteria (eg surname only)

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    You want it to highlight or select a row?
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    There's probably a much better way but you could put the data in a listbox and then search the listbox....see attached.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  4. #4
    VBAX Newbie
    Joined
    Jul 2006
    Location
    Melbourne, Australia
    Posts
    2
    Location

    Re search

    Thanks for your prompt reply Lucas
    What I cuurrently have are 4 worksheets and WKS' 2-4 have regional contact details. On the first WKS I have two inputBoxes, one for firstname and one for surname, plus a search button and a listbox. When a match is found (and there may be more than one match) I get it to place the match/es into the listbox. My problem is that I thought surname would be enough to search on but now realise it would be more versatile to be able to search by both firstnam and surname or either. I do not need the rows in the worksheets highlighted I need the rows copied to the listbox.

Posting Permissions

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