Hello,
How do i put a something if lets say my return value is nothing(0) or blank in vlook up.
How do i put a something if lets say my return value is nothing(0) or blank in vlook up.
VBA Code:
Private Sub textboxProductID_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
On Error GoTo MyErrorHandler:
If KeyCode = vbKeyReturn Then
Dim z As Double
z = textboxProductID.Value
textboxPrevious.Text = Application.WorksheetFunction.VLookup(z, Worksheets("Data").Range("TableRange"), 6, False) ----->"if False then it will show the Value that its looking for,if True to show "New Data" instead of just empty textbox.
Else
End If
Exit Sub
MyErrorHandler:
If Err.Number = 1004 Then
MsgBox "New Data."
End If
End Sub