+ Reply to Thread
Results 1 to 3 of 3

Vlookup in UserForm - Get Input from listbox, Lookup in specific table from specific sheet

  1. #1
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Vlookup in UserForm - Get Input from listbox, Lookup in specific table from specific sheet

    Hello VBA Experts,

    I am trying to do a Vlookup in a UserForm where it will get the input from a listbox, do a vlookup from a specific table from a specific sheet, and put the lookup value in a textbox in the original UserForm. For example, I have a worksheet called "Company" and in this worksheet I have the Company Name and their associated phone number. I have the button to show my UserForm on another worksheet in the same workbook. When I click the button, the UserForm appears. In this UserForm, I have a list box to show Company Names. Below the listbox I have a textbox for phone numbers. Instead of typing the phone number in all the time, I would like to know if there is a way to populate the phone number using a vlookup formula where it would take the value from the list box from the userform, go to the worksheet called "Company", find the phone number, and bring it back to the phone number textbox in the userform.

    Please let me know if this is doable.

    Thank you in advance for your help!

    J

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Vlookup in UserForm - Get Input from listbox, Lookup in specific table from specific s

    assign string to phone ie strPhone

    strPhone = Application.WorksheetFunction.VLookup(etc)
    textbox.text = strPhone

    you could probably skip the assign but for learning its easier to understand imo

    also if you have to use phone anywhere else you have option to use it
    Last edited by humdingaling; 08-25-2013 at 09:01 PM.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    12-19-2012
    Location
    Woodbridge, Virginia
    MS-Off Ver
    Excel 2010
    Posts
    111

    Re: Vlookup in UserForm - Get Input from listbox, Lookup in specific table from specific s

    That worked!! Thank you!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Using Listbox selection to show specific labels and texboxes on userform
    By jlwiii34 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2013, 03:17 PM
  2. [SOLVED] Input Userform Data into Specific Cells & Loop?
    By shiftyspina in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2013, 07:00 AM
  3. [SOLVED] listbox on userform not showing specific cells
    By cfinch100 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-23-2013, 12:29 PM
  4. Replies: 0
    Last Post: 09-17-2012, 11:10 AM
  5. [SOLVED] If Userform ListBox contains specific item then change label background colour.
    By jamieswift1977 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 09-06-2012, 06:38 AM

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