yasirsaeed2002
New Member
- Joined
- Mar 26, 2017
- Messages
- 30
Hi Guys,
I am inexperienced in VBA. I have written the following code. The program runs once if the Name is not found but returns error 91 If I retry rather than going to Namecorrection Label. I wonder why?
Thanks in Advance
Yasir
Dim Name as String
RetryAgain:
Name = Inputbox("Type in Your Name Here")
On Error GoTo NameCorrection
Range("B1", Range("B1").End(xlDown)).Find(name).Select (Error 91 here the 2nd time)
On Error GoTo 0
NameCorrection:
MBox = MsgBox("The Name You Entered was Not Found. Do you Want To Try Again", vbRetryCancel)
If MBox = vbRetry Then GoTo RetryAgain
I am inexperienced in VBA. I have written the following code. The program runs once if the Name is not found but returns error 91 If I retry rather than going to Namecorrection Label. I wonder why?
Thanks in Advance
Yasir
Dim Name as String
RetryAgain:
Name = Inputbox("Type in Your Name Here")
On Error GoTo NameCorrection
Range("B1", Range("B1").End(xlDown)).Find(name).Select (Error 91 here the 2nd time)
On Error GoTo 0
NameCorrection:
MBox = MsgBox("The Name You Entered was Not Found. Do you Want To Try Again", vbRetryCancel)
If MBox = vbRetry Then GoTo RetryAgain