这是帮助中的例子
Sub main
Dim str1 as String
Dim answer as Integer
Dim nextweek
Dim msgtext
i: str1=InputBox$("Enter a date:") ‘定义label所在的位置
answer=IsDate(str1)
If answer=-1 then
str1=CVDate(str1)
nextweek=DateValue(str1)+7
msgtext="One week from the date entered is:"
msgtext=msgtext & Format(nextweek,"dddddd")
MsgBox msgtext
Else
MsgBox "Invalid date or format. Try again."
GoTo i '回到label处执行
End If
End Sub