A Simply ComboBox Selection returns value to TextBox

G

Guest

I have a userform with a simply ComboBox named (cboAtty) who's ROWSOURE
PROPERTIES are =Data!A2:A30, with a SHEET Called Data, with info on A2:B30,
The info is a Name Listing in Column A, with Bar# in Column B)(A2:B30).

On the userform is COMBOBOX called cboAtty & a TEXTBOX called (tbBar)
Here is my Code that always fails:

Private Sub cboAtty_Change()
tbBar.Value = Application.VLookup(cboAtty.Value, Sheet1.Range("A2:B30"), 2,
False)
End Sub

Objective is to return the cell info In Column B based on ComboBox selection
of Column A. Into my TextBox.
I don't know what Value Sheet1 has, weather it's empty of same data, seems
to not matter.

Thanks on this.. I'm just stuck, read all the posts... still to no avail.
 
G

Guest

Hi,
This definitely works for me:

Private Sub cboAtty_Change()
tbBar.Value = Application.VLookup(cboAtty.Value,
Worksheets("Data").Range("A2:B30"), 2, False)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top