Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code for a combobox lookup but it will not find the
value when the combox text is a number: Private Sub ComboBox1_Click() Dim nMatch As Long With ComboBox1 If .Text < "" Then On Error Resume Next nMatch = WorksheetFunction.Match(CStr(.Text), Worksheets("Produced").Range("A3:A500"), 0) On Error GoTo 0 If nMatch < 0 Then TextBox1.Text = WorksheetFunction.VLookup(CStr(ComboBox1.Text), Worksheets(" Produced").Range("A3:Z500"), 2, False) Else MsgBox "Value Not Found" .SelLength = Len(.Text) .SelStart = 0 .SetFocus Cancel = True End If End If End Sub Cheers Greg |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Post code lookup | Excel Worksheet Functions | |||
Zip Code Lookup Add-in | Excel Discussion (Misc queries) | |||
vba code for lookup worksheet function | Excel Programming | |||
code for lookup,& triggers. | Excel Programming |