Log in

View Full Version : UserForm Concept help



mike31z
05-10-2007, 05:02 AM
I am new to UserForms and would like to know is it possible to reterive various cell data after a value is intered into the first TextBox?

Example:
If the first TextBox has a label of Part No. and you enter that part number when you tab to the next field some of the TextBox display values based on that part number you just added.

If this is possible.

Then when the rest of the TextBox fields are filled can this collection of fields be saved to a new location?

I hope I expressed myself good enough so you can understand.

mike in wisconsin

rrenis
05-10-2007, 05:51 AM
Not too sure if this is what you're after but you could try the following to build up a string based on your selection.

This assumes you have 4 listboxes with data in and one listbox (ListBox5) to build up your selection...


myRef1 = ListBox1.Value
myRef2 = ListBox2.Value
myRef3 = ListBox3.Value
myRef4 = ListBox4.Value

ListBox5.AddItem myRef1 & myRef2 & myRef3 & myRef4

Hope this helps.

Cheers,
rrenis

Edit: Built the ListBox5 entry using Strings (Presumes you're using the same command button to progress through the Part Numbers, if not place the Dim myRefX As String at thetop of your module and addd ListBox5.AddItem myRef1 & myRef2 & myRef3 & myRef4 to each button.

lucas
05-10-2007, 08:40 AM
I would use a combobox and additem to select the part numbers but attached is a simple example that you can expand on that does what you want...I think

mike31z
05-12-2007, 06:57 AM
rrenis and lucas that you for answering my previous question.

I hope this is the correct place to put this question

The problem shown in the pictures went away after I closed exccel and started the lawn mower. May be the references reset them self's when I restarted excel.

thanks any way

http://www.picpile.net/ims/pic_310R0Na5/16757.jpg

When I click on the debug I get

http://www.picpile.net/ims/pic_310R0Na5/16758.jpg



Mike in wisconsin

mike31z
05-12-2007, 08:41 AM
lucas. I have looked at the userform you created and I still can not figure out how "wiget" is returned when the 555 number is added?


mike in wisconsin

lucas
05-12-2007, 08:49 AM
It ran for me Mike....what is the question?

lucas
05-12-2007, 08:52 AM
Mike,
its in the textbox1 beforeupdate event:
If TextBox1.Text = "555-5555" Then Label2.Caption = "Wigget"