Maybe like this:
![]()
Private Sub Itemnum_AfterUpdate() Dim val As String With userforms1 val = .Itemnum.Value If IsError(Application.Match(val, Range("price").Columns(1), 0)) Then MsgBox ("Invalid Item Number!") .Itemnum.SetFocus Exit Sub Else .desc.Value = WorksheetFunction.VLookup(val, Range("price"), 2, False) End If ' ... End With End Sub
Bookmarks