D
daniel chen
The following Macro will not loop more than twice the error entries.
Will someone help me correct it to loop indefinely? Thanks
Sub Entry_validation()
Dim Teststring As String
Dim Inputstring As String
Cells(1, 1) = "ABC" 'as given filename
Cells(2, 1) = "DEF" 'as given filename
Cells(3, 1) = "GHI" 'as given filename
Cells(4, 1) = "JKL" 'as given filename
errorloop:
Inputstring = InputBox(prompt:="Enter Filename" & vbLf & "Enter abort
to abort entry" & "")
If Inputstring = "abort" Then GoTo eof
On Error GoTo errornote
Teststring = Application.Match(Inputstring, Range("A1:A10"), 0)
MsgBox "A valid entry."
GoTo eof
errornote:
MsgBox "Not a valid entry." & vbLf & "Try again"
GoTo errorloop
eof:
End Sub
Will someone help me correct it to loop indefinely? Thanks
Sub Entry_validation()
Dim Teststring As String
Dim Inputstring As String
Cells(1, 1) = "ABC" 'as given filename
Cells(2, 1) = "DEF" 'as given filename
Cells(3, 1) = "GHI" 'as given filename
Cells(4, 1) = "JKL" 'as given filename
errorloop:
Inputstring = InputBox(prompt:="Enter Filename" & vbLf & "Enter abort
to abort entry" & "")
If Inputstring = "abort" Then GoTo eof
On Error GoTo errornote
Teststring = Application.Match(Inputstring, Range("A1:A10"), 0)
MsgBox "A valid entry."
GoTo eof
errornote:
MsgBox "Not a valid entry." & vbLf & "Try again"
GoTo errorloop
eof:
End Sub