View Full Version : Controlling userform data with combobox.

05-30-2006, 03:49 AM

I would like to be able to control a userform with a combobox. Depending on what option i choose in the combobox, i want to fill in the corresponding values in textboxes.

The values are all stored in an excel sheet as follows

Combobox Textbox1 Textbox2 Textbox3
A 1 6 11
B 2 7 12
C 3 8 13
D 4 9 14
E 5 10 15

So if i choose A in the combobox , i want the values 1, 6 and 11 to be loaded in the textboxes.

Thank you !

05-30-2006, 04:08 AM
Where are these values stored and how are you populating the combobox?

See the attached file.

05-30-2006, 04:30 AM
The combobox contains names of machinery which will not cange.

The value in the textbox, wich i want to load from a different sheet, is a maximum limit for accumulated flow of liquid nitrogen, hydrogen or ethene through the machinery.

I will attach a copy containing the interesting bits in the xls sheet.

Sheet 2 is a copy of the reference doc i want to get info from.
The interesting columns are A(ComboBox) and E(TextBox).

05-30-2006, 05:32 AM
**Thank you vwery much for the response ,the demo solved most of my problems, but i still have a dilemma.

**How do i modify the following code to load data from a sheet called ref.Sheet instead of the main sheet ?

**Private Sub ComboBox1_Change()
**Me.Controls("TextBox1") = Range("A" & ComboBox1.ListIndex + 1).Offset(, 4)
**End Sub

**Thank you !

Sorry ! Just ignore this message !
I didn't realize that you had allready solved my issues (Excel issues)! I had a 4 day drinkingspree last week .. must have affected my brain....

Thank you very much for all your help !