+ Reply to Thread
Results 1 to 7 of 7

Coding for Input Box Search ...

  1. #1
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183

    Question Coding for Input Box Search ...

    Hi, could someone give me a code that will allow text box input to be
    searched for a match on all worksheets in location D17 of all worksheets?

    Example: Please Enter Your Search Name: James

    James would be searched for on all worksheets in cell D17, The first Sheet
    That Finds James at D17 becomes active sheet.

    Thanks For any Assistance On This..

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    See if this will work for you:
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Jason

    This is one way to do it

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Ah, yes, more efficient, and takes into account upper/lower case and if cancel is selected. Very good.

  5. #5
    Forum Contributor
    Join Date
    07-02-2006
    Location
    Love City, USA
    Posts
    183
    Hey, Thanks Alot for the Codes!

    I am getting a run-time 1004 error with your code mudraker. It reads:

    'Activate Method of Range Class Failed'

    It only does it if the input is Found... But works if the input isn't found..

    This is what is hilighted: wS.Range("d17").Activate

    Thanks.

  6. #6
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    I don't know if I would say mine is more efficient than Jason's. Just does more checking.

    With Jason's you don't need to worry about upper & lower case text.
    & my MsgBox "Name Not Found", vbInformation is in the wrong location.

    My code corrected.

    Please Login or Register  to view this content.
    This macro is made up of part Jason's code & part my code.
    As to which way is best I don't know

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Something I overlooked when I tested it.
    The sheet with the name I was finding was active. Code works corectly.

    When the sheet is not active you get the error message

    This fixes the problem

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1