Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto fill text boxes in user form by inputting data in another
I have a user-form set up which has 5 text boxes which need to have tex
put in them. I also have a page with all the info required for the abov boxes so I am trying to find some way that I can input data into one o the boxes and the other boxes will then be automatically filled in wit the info from the page mentioned. The info is a database list with separate row for each entry and there are 10 columns with 10 differen parts of the data. Have I explained this properly and, if so, can anyone help ? Thanks in advance, JOH -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto fill text boxes in user form by inputting data in another
Assume Textbox1 is where you enter the data
Data is on Sheet1, Range A1:J50 Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim rng as Range, rng1 as Range, res as Variant set rng = Worksheets("Sheet1").Range("A1:J50").columns(1) res = Application.Match(Textbox1.Text, rng,0) if not iserror(res) then set rng1 = rng(res) Textbox2.Text = rng1.offset(0,1) Textbox3.Text = rng1.offset(0,3) Textbox4.Text = rng1.offset(0,7) Textbox5.Text = rng1.Offset(0,10) Else msgbox "Not found in database End if End Sub This assumes the value in Textbox1 is alphanumeric. If it is numeric and the entries in the cells in the lookup column are numeric then you would need res = Application.Match(cdbl(Textbox1.Text), rng,0) -- Regards, Tom Ogilvy -- Regards, Tom Ogilvy "Finny33 " wrote in message ... I have a user-form set up which has 5 text boxes which need to have text put in them. I also have a page with all the info required for the above boxes so I am trying to find some way that I can input data into one of the boxes and the other boxes will then be automatically filled in with the info from the page mentioned. The info is a database list with a separate row for each entry and there are 10 columns with 10 different parts of the data. Have I explained this properly and, if so, can anyone help ? Thanks in advance, JOHN --- Message posted from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Form Text Boxes - Copy format of text boxes | Excel Discussion (Misc queries) | |||
How do I fill a cell in a user form from a selection on same form? | Excel Discussion (Misc queries) | |||
How do i fill the adjacent cell formulas in user form when i press | Excel Discussion (Misc queries) | |||
Allow user to fill in on-line form without changing formatting | Excel Worksheet Functions | |||
Auto loading of a user form sometimes | Excel Programming |