+ Reply to Thread
Results 1 to 6 of 6

Macro in sheet one to create a search for names in sheet 2

  1. #1
    Registered User
    Join Date
    11-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Macro in sheet one to create a search for names in sheet 2

    Hi, I am using Excel 2010.

    What formula would i use to enable the following;

    In sheet one, i am creating a main page with a menu bar. In this menu bar I would like to ceate a macro which does the following;
    Once clicked upon, It will ask for an employee number. Once the employee number is entered, it will extract data from sheet 2 and show the only records from that employee number (please note there could be many records for that one employee number).

    Sheet 2 has the following context,

    Employee Number Name Age Contact Number etc

    If more information is needed, please request.

    Thank you for your time and help in advance.

    Camilla

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Macro in sheet one to create a search for names in sheet 2

    A sample workbook would be good, please attach one as this makes it a lot easier to find a solution for you.

    Sean

  3. #3
    Registered User
    Join Date
    11-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Macro in sheet one to create a search for names in sheet 2

    Here you go.

    Thanks.
    Camilla
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Macro in sheet one to create a search for names in sheet 2

    Here you are Camilla.
    Hopefully this is what you are after

    Sean
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-14-2012
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: Macro in sheet one to create a search for names in sheet 2

    Thanks Sean. This is very helpful .
    Just a few pointers please;

    Where do i change the cells of info in copies? As in what if i want more colums to be added to the search?
    My search returns with the information on the top of the screen, not below?

    Also is it possible to create a button that then allows for the user to clear the search?

  6. #6
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Macro in sheet one to create a search for names in sheet 2

    Hope this helps Camilla

    Please Login or Register  to view this content.
    This is the code to clear the old entries, you can put this in a standard module and assign the macro to a button. Or place it in the Sheet module and call the code from the user button click.

    Please Login or Register  to view this content.
    just change the sheet or range to what you want to clear.

+ 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