+ Reply to Thread
Results 1 to 5 of 5

Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    Barrie, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

    Good Morning All,

    I can't help but think that there has to be an easy fix for this. I have a workbook with 500 sheets - one for each employee's attendance card. (I know that Excel is not the optimum program for this, but have to work with it).

    I need a macro or VB script that does the following:

    1. On button click, opens a user input box that says "Enter Associate Name"
    2. Once the user submits, it looks across all the worksheet names, and activates the first worksheet that meets the string entered, leaving the input box open. If the user clicks cancel on the input box, the macro stops. If the user clicks OK again, the next matching worksheet is activated, and so on.

    I am new to VB programming and could really use a hand. I know you can use the CTRL F search and select "Search Entire Workbook", but this means an extra few steps for every search.

    Many thanks,
    HRGoddess

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

    Maybe?

    Please Login or Register  to view this content.

  3. #3
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

    Hi HRGoddess,

    Please have a look at the attached example. This solution uses a UserForm because an InputBox is automatically closed once an input has been provided and the ok or cancel button is clicked.

    The search via this form is executed case sensitive, unless you tick the checkbox to ignore cases. The search argument can either be a full name, or you can use wildcards like * or ?.
    Attached Files Attached Files
    If you like my contribution click the star icon!

  4. #4
    Registered User
    Join Date
    01-15-2013
    Location
    Barrie, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

    Works like a charm, thank you so much!

  5. #5
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Macro that Finds and Goes To the First Matching Worksheet Name Based On User Input Box

    You are very welcome

+ 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