I am trying to find a number in a string given via textbox in excel vba and display an error saying it cant continue and after that it must stop from loading the codes below.
fname is Full Name given by the user
If InStr(fname, "0") Then
MsgBox ("Number Found In Your Name. Please Correct That!!")
Dim i(0 To 9) As String
i(0) = "0"
i(1) = "1"
i(2) = "2"
i(3) = "3"
i(4) = "4"
i(5) = "5"
i(6) = "6"
i(7) = "7"
i(8) = "8"
i(9) = "9"
If InStr(fname, "0") Then
MsgBox ("Number Found In Your Name. Please Correct That!!")
End If
It is supposed to search in the text given by the user and display an error if it contains a number(list of numbers)