+ Reply to Thread
Results 1 to 4 of 4

how to use VBA to search and return search result in the user form

  1. #1
    Registered User
    Join Date
    02-25-2013
    Location
    Singapore
    MS-Off Ver
    Excel 2010
    Posts
    2

    how to use VBA to search and return search result in the user form

    Hi guys, I need help for the following:

    Currently, I have created a VBA form to search using either Student's name or Identification Number. What I would like to know is, How do I create a VBA code such that when i enter either the Student's name or Identification number, it will search through one excel sheet (that contains all the student's data) and return the result of this search within the user form. I do not want the Search function to bring me to the data in the other excel sheet.

    I've attached how the userform should look like.

    Also, all the data from which this search function would extract the search results are placed in a separate excel worksheet with columns starting with Names, Date of birth, Reading age, Spelling age, etc.. So essentially, once the search name coincides with the name in the data, VBA code is used to pull out all the relevant data of this person and display it on the Search Userform.

    Thank you so much! Appreciate any form of help!!
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: how to use VBA to search and return search result in the user form

    For starters i would suggest you change the textboxes to a Listbox or Combobox, that are populated with all the names or ID No.

    This way a spelling mistake or typo will not eliminate the required name or id.

    Use the Userform Initialise event to populate the Listboxes or Comboboxes with the names and ID's.

    The user then selects the name or id from either the listbox or combobox, then the other data can be populated by a search.

  3. #3
    Forum Contributor
    Join Date
    01-02-2007
    Location
    Australia NSW
    MS-Off Ver
    2013
    Posts
    494

    Re: how to use VBA to search and return search result in the user form

    Have a look at the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-20-2013
    Location
    Nairobi, Kenya
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    3

    Post Re: how to use VBA to search and return search result in the user form

    You can suit this code to your own

    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)

Tags for this Thread

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