My code essentially starts with a loop, and I'm trying to make it restart either the loop or the sub, either one, after an error. Not sure how to do this, and Google isn't helping me.
Code is below, but my goal of this part of the code was to find a document number and activate that cell (so I can use activecell in later parts of the code), but to have the code show a pop up stating no document number and then restart if the document number isn't found.
Sub blah()
Dim Answer As String
Dim Looper As String
Looper = "a"
Do While Not Looper = vbNullString
Answer = InputBox("Document Number?")
If Answer = vbNullString Then
Exit Sub
Else
On Error GoTo NoDocNumber
Range("G1").Select
Cells.Find(What:=Answer, LookIn:=xlValues).Activate
End If
NoDocNumber:
MsgBox ("Document Number " & Answer & " was not found.")
'NOW HOW TO MAKE IT RESTART THE SUB OR LOOP
End Sub
Also - is this an ideal way to find things (Control F style) via VBA, or is there a better way to do this?
Thanks for your time and assistance!
Bookmarks