+ Reply to Thread
Results 1 to 3 of 3

userform, label text display value depends on user input

  1. #1
    Registered User
    Join Date
    12-19-2011
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    1

    userform, label text display value depends on user input

    Hi everyone, i'm a newbie in VBA and i appreciate any help that i can get! i'm creating a userform and in one of the text box user would enter their predefine ID (somewhere on the excel sheet). base on their input ID i would like the label underneath the text box to display their name. (which is also predefine on the excel sheet. would i be using the "Index & Match" function? if so, how would i write this in my code? Thank you very much for your help!!!

    Dave

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: userform, label text display value depends on user input

    Hi Dave, welcome to the forum.

    The following code in your UserForm module should do the trick. You may need to adjust the object names (TextBox1, Label1, etc.) and the VLookup range / column.
    Please Login or Register  to view this content.
    This assumes you're looking up a text string in a table of text strings. If you're working with numbers, slight adjustments are needed.

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: userform, label text display value depends on user input

    ZZZ- Names and IDs.xls

    Dave,

    I posted an alternative method of performing your application (see linked attachment above). Take a look at the workbook and see if this can suit your needs. I chose a combo box instead of a textbox for ID entry.

    Let me know if you can use this.

+ 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