Sub sValidate() Dim num As String, chK As Long, r As Long, e As Long num = Application.InputBox(prompt:="Enter: Customer Account Number:", Type:=1) If num = 0 Then MsgBox "Incorrect Customer Account Number!. Please Re-Enter Next Customer Account Number!" Exit Sub End If On Error Resume Next r = Sheets("Source data").Range("A2:A500000").Find(num, , , xlWhole).Row e = Err.Number On Error GoTo 0 If e <> 0 Then MsgBox "Customer Account Number Not Found!" Exit Sub End If MsgBox "You Entered Customer Account Number " & num & " which matches " & Range("B" & r).Value End Sub
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.