Analytics with Excel______________________________________RaviKanth Janapareddy
The GoTo Statement
Sub GoToDemo()
UserName = InputBox(“Enter Your Name: “)
If UserName <> “Bill Gates” Then GoTo WrongName
MsgBox (“Welcome Bill...”)
‘ ...[More code here] ...
Exit Sub
WrongName:
MsgBox “Sorry. Only Bill Gates can run this.”
End Sub
No comments:
Post a Comment