Dim part As String
Dim found As Range
newPart:
Windows("Master Cleaned Kits Oct updated.xlsx").Activate
part = InputBox("Enter Part No.", "Part Number Lookup")
Set found = Cells.Find(what:=part, After:=ActiveCell, LookIn:=xlFormulas,LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
If found Is Nothing Then
msg2 = MsgBox("Error! Invalid part number.", vbOKOnly)
GoTo newPart
End If
Range(ActiveCell, ActiveCell.End(xlDown).Offset(-1)).Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
When I run this macro, I get a run time error 424 on the Find
.
I am looking for the macro to return to the newPart:
label if the number entered is incorrect or left empty so that the user can try enter the part number again.