Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Having data populate text boxes based on Combobox Value
On Sheet2 I have a table comprised of 3 columns. the
table is located in Range A3:C52. In Range A3:A52, there are Employee ID numbers. In Range B3:B52, there are Names. In Range C3:C52, there are Email Addresses. On a userform(Userform3), I have a ComboBox(ComboBox1). ComboBox1 can contain the employee ID, Name, or Email Address. UserForm3 also contains 3 text boxes. Textbox1, TextBox2, and TextBox3. TextBox1 is where the Employee ID will be, TextBox2 is where the Name will be, and TextBox3 is where the Email Address will be. The values in these 3 textBoxes will depend on what the value of ComboBox1 is. I need for these 3 textboxes to look at the value in ComboBox1 and then look at the table on Sheet2 Range A3:C52 and pull back the corresponding data. I need for this data to be put in the 3 textboxes. For instance, if ComboBox1 contains the value "Todd Huttenstine", I need for TextBox1, TextBox2, and TextBox3 to display the corresponding data. Lets say the value "Todd Huttenstine" is located in cell A14 in the Table (which is located in Range A3:C52). Because the Value Todd Huttenstine is found within this range, the textboxes populate with the corresponding value. That is Textbox1 populates with the A column value(Cell A14 value), Textbox2 populates with the B column value(Cell B14 value), and Textbox3 populates with the C column value(Cell C14 value). Regardless of if Employee ID number, Name, or Email Address is in ComboBox1, I need the textboxes to auto- populate with the corresponding values in the table on sheet2. I hope this is not confusing. Thanks in advance. Todd Huttenstine |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Having data populate text boxes based on Combobox Value
If this is the same userform as in your option button post, you have left
out any information on how it could be determined which column the combobox is displaying. Also, you have not talked about your data - where is it possible blanks would be found - are there blanks within the populated cells - would there be a ID, name and no email, a name and email, but no id, or are all blanks at the end of the column and if so, then why specify row 53 as the end. The easiest way to do this would be to populate the combobox with all three columns and get your data from there. Even if you only want to display one set of data, you could control this with the columnwidth. Alternately, you could make the combobox have two columns and place the row number in the second column and hide that column. Give it a whirl, then post your code if you have a question. -- Regards, Tom Ogilvy Todd Huttenstine wrote in message ... On Sheet2 I have a table comprised of 3 columns. the table is located in Range A3:C52. In Range A3:A52, there are Employee ID numbers. In Range B3:B52, there are Names. In Range C3:C52, there are Email Addresses. On a userform(Userform3), I have a ComboBox(ComboBox1). ComboBox1 can contain the employee ID, Name, or Email Address. UserForm3 also contains 3 text boxes. Textbox1, TextBox2, and TextBox3. TextBox1 is where the Employee ID will be, TextBox2 is where the Name will be, and TextBox3 is where the Email Address will be. The values in these 3 textBoxes will depend on what the value of ComboBox1 is. I need for these 3 textboxes to look at the value in ComboBox1 and then look at the table on Sheet2 Range A3:C52 and pull back the corresponding data. I need for this data to be put in the 3 textboxes. For instance, if ComboBox1 contains the value "Todd Huttenstine", I need for TextBox1, TextBox2, and TextBox3 to display the corresponding data. Lets say the value "Todd Huttenstine" is located in cell A14 in the Table (which is located in Range A3:C52). Because the Value Todd Huttenstine is found within this range, the textboxes populate with the corresponding value. That is Textbox1 populates with the A column value(Cell A14 value), Textbox2 populates with the B column value(Cell B14 value), and Textbox3 populates with the C column value(Cell C14 value). Regardless of if Employee ID number, Name, or Email Address is in ComboBox1, I need the textboxes to auto- populate with the corresponding values in the table on sheet2. I hope this is not confusing. Thanks in advance. Todd Huttenstine |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Populate Text based on conditions | Excel Worksheet Functions | |||
Pulling data from other wb based on data to populate dropdown list | Excel Discussion (Misc queries) | |||
Populate column based on data in other cells | Excel Discussion (Misc queries) | |||
How do i populate a text box according to selection in combobox? | Excel Worksheet Functions | |||
Populate Userform text boxes in VBA with VLookup data from #2 worksheet | Excel Programming |