Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Vlookup Problem
I have a userform with textbox3. The user enters a value into textbox3.
When the user moves to the next userform control, I want VBA to check the value entered in textbox3 against a table I have on a worksheet (CE Tables). If the value exists in the table, the focus will move to the next control, but if the value doesn't exist, I want a msgbox to give a warning, then clear the value and return to textbox3. Currently, I get a "Type Mismatch" with MsgBox varDN.Value. Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim varDN As Variant varDN = Application.VLookup(TextBox3.Value, Worksheets("CE Tables").Range("O:O"), 1, False) MsgBox varDN.Value If IsError(varDN) = True And TextBox3.Value < "" Then MsgBox "Non-Standard DN Value" TextBox3.Value = "" Textbox3.SetFocus End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
VLOOKUP Problem, Please Help! | Excel Discussion (Misc queries) | |||
VLOOKUP problem | Excel Discussion (Misc queries) | |||
Vlookup problem.. | Excel Worksheet Functions | |||
vlookup problem | Excel Discussion (Misc queries) | |||
Vlookup problem | Excel Worksheet Functions |