View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Userfrm Lookup Works For text not Number

What error do you get?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"gregork" wrote in message
...
Hi,
I have the following code for inserting data on a user form

based on a
number on a cell in a worksheet:


Private Sub ComboBox1_Click()
TextBox2.Text = WorksheetFunction.VLookup(ComboBox1.Text,
Worksheets("Blending Details").Range("A2:Z500"), 2, False)

End Sub

When I put a word in the combo box the lookup is successful and

I get the
value returned in textbox2. But when a number is in the combox

I get a
runtime error.
Any ideas?

Thanks
gregork