View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
thom hoyle thom hoyle is offline
external usenet poster
 
Posts: 24
Default A Simply ComboBox Selection returns value to TextBox

Worked like a charm, Thank you Toppers... seems my code was screwed up...

"Toppers" wrote:

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



"thom hoyle" wrote:

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.