本示例先取得一个日期,再用 DateAdd 函数显示未来数月后的日期。Dim FirstDate As Date ' 声明变量。Dim IntervalType As StringDim Number As IntegerDim MsgIntervalType = "m" ' "m"指定以“月份”作为间隔。FirstDate = InputBox("Enter a date")Number = InputBox("Enter number of months to add")Msg = "New date: " & DateAdd(IntervalType, Number, FirstDate)MsgBox Msg