Public Function old(MyDate)
If isdate(MyDate) then
MyYear = Year(MyDate)
Cyear=Year(date)
if (MyYear>Cyear) then
msgbox "出生年("&MyYear&")不可以大于当前年 "
else
ōld=Cyear-MyYear
end if
else
msgbox "错误的日期"
end if
End Function
ddate="October 19, 1962"
old1=old(ddate)
msgbox("您的岁数是:"old1)