combobox selection to textbox in userform

Status
Not open for further replies.

rharri1972

Board Regular
Joined
Nov 12, 2021
Messages
132
Office Version
  1. 2019
Platform
  1. Windows
Hello!
I have a userform with a combobox1 and I am attempting to have information from the range of cells in the worksheet populate textboxes on the same userform.

I am trying with only one textbox at the moment and figured once I get the code right I should be able to add the others.

Here is the code that i found on Google that keeps returning cannot get the vlook up property of the worksheet function class:


Private Sub UserForm_Initialize()
Dim xRg As Range
Set xRg = Worksheets("Customers Select").Range("A2:G1000")
Me.ComboBox1.List = xRg.Columns(1).Value

End Sub

and for the combobox1

Private Sub ComboBox1_Change()
Me.TextBox13.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, xRg, 2, False)


End Sub

Any help please?
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hello!
I have a userform with a combobox1 and I am attempting to have information from the range of cells in the worksheet populate textboxes on the same userform.

I am trying with only one textbox at the moment and figured once I get the code right I should be able to add the others.

Here is the code that i found on Google that keeps returning cannot get the vlook up property of the worksheet function class:


Private Sub UserForm_Initialize()
Dim xRg As Range
Set xRg = Worksheets("Customers Select").Range("A2:G1000")
Me.ComboBox1.List = xRg.Columns(1).Value

End Sub

and for the combobox1

Private Sub ComboBox1_Change()
Me.TextBox13.Text = Application.WorksheetFunction.VLookup(Me.ComboBox1.Value, xRg, 2, False)


End Sub

Any help please?
This looks like the same question you asked earlier and I gave you a script.
But in your first posting you said load all the values in the range to Combobox1
 
Upvote 0
This looks like the same question you asked earlier and I gave you a script.
But in your first posting you said load all the values in the range to Combobox1
a little different... now that i have the combobox listed correctly I now need to know how to send values to different textboxes...I need the values in the combobox because i have same customer in different locations so i need to make sure i am selecting the correct customer name and location. Then I need to have the values that are related to the selected customer populate mulitple different textboxes on the userform. I am trying to do this step by step as to not have an over abundance of information as I go. It also helps me learn step by step.
 
Upvote 0
Duplicate to: combo box selection

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,925
Messages
6,122,301
Members
449,078
Latest member
nonnakkong

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