Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I am trying to get a textbox (textbox2) in a userform to vlookup data (entered into textbox1) from cells ("a1:b10"). Can anybody please advise if this can be done and how? thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim Res as Variant
res = application.vlookup(me.textbox1.value, _ thisworkbook.worksheets("sheet999").range("a1:B10" ),2,false) if iserror(res) then me.textbox2.value = "No match, the board goes back" else me.textbox2.value = res end if ==== You may want to change the workbook and the sheetname, though. wrote: Hi I am trying to get a textbox (textbox2) in a userform to vlookup data (entered into textbox1) from cells ("a1:b10"). Can anybody please advise if this can be done and how? thanks -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to get a textbox (textbox2) in a userform to vlookup data
(entered into textbox1) from cells ("a1:b10"). Can anybody please advise if this can be done and how? Maybe you can use the VBA Find function instead. Assuming you are looking up your values in Column A and returning the corresponding values from Column B, I would think this code could be used (change the Find properties as required)... On Error Resume Next TextBox2.Text = ActiveSheet.Range("A1:A10").Find( _ What:=TextBox1.Text, MatchCase:=False, _ SearchOrder:=xlByColumns).Offset(0, 1).Value If Err.Number Then TextBox2.Text = "No Match Found" Rick |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub TextBox1_Change()
On Error Resume Next Me.TextBox2 = "" Me.TextBox2 = Range("A1:A10").Find(Me.TextBox1, LookIn:=xlValues).Offset(0, 1) End Sub " skrev: Hi I am trying to get a textbox (textbox2) in a userform to vlookup data (entered into textbox1) from cells ("a1:b10"). Can anybody please advise if this can be done and how? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
UserForm TextBox | Excel Programming | |||
Userform TextBox | Excel Programming | |||
TEXTBOX in USERFORM | Excel Programming | |||
Textbox in userform | Excel Programming | |||
UserForm TextBox to ActiveSheet TextBox over 256 characters | Excel Programming |