Userform to input value from worksheet after name has been selected

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
Hi,
I would like to select a name in my TextBox userform & have other values taken from worksheet database & populate other Textboxes on the userform.

Some info for you.
Userform is called ADD CUSTOMER
Worksheet is called G INCOME
Userform TextBox1 is NAME
Userform TextBox2 is ADDRESS
Userform TextBox3 is POST CODE
Userform TextBox4 is MILES

My databse is currently U4:X21 but will carry on down the page
Column U is NAME
Column V is ADDRESS
Column W is POST CODE
Column X is MILES

So it should work like this.
On the userform clicking TextBox1 NAME drop down arrow i then see the customers that are in my database in column U
I select a customer & i see his name now appear in TextBox1
Also i should see the other TextBoxes 2,3 & 4 prefilled with the values taken from database columns V,W & X
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
@Fluff please can you advise on this.

I have found an old post & used the code.
Here is the post.

Here is what i have & fills my Textboxes all fine
Rich (BB code):
   Private Sub ComboBox1_Click()
   Me.TextBox2.Value = Sheets("G INCOME").Range("V" & Me.ComboBox1.ListIndex + 4).Value
   Me.TextBox3.Value = Sheets("G INCOME").Range("W" & Me.ComboBox1.ListIndex + 4).Value
   Me.TextBox5.Value = Sheets("G INCOME").Range("X" & Me.ComboBox1.ListIndex + 4).Value
   End Sub

Then i have this & it popultes the ComboBox BUT im not sure what i should be using where in the other persons code A is used
Rich (BB code):
    With Sheets("G INCOME")
      Me.ComboBox1.List = .Range("U4:U" & .Range("A" & Rows.Count).End(xlUp).Row).Value
    End With
 
Upvote 0

Forum statistics

Threads
1,214,832
Messages
6,121,843
Members
449,051
Latest member
excelquestion515

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top