依 DateSerial 或 DateValue 產生的順序日期,傳回某年中的某月。
Month (Number)
Integer
Number:數值表示式,包含用於確定年份中月份的順序日期數。
此函數是 DateSerial 函數的逆運算。它依 DateSerial 或 DateValue 所產生的順序日期,傳回某年中的某月。例如,表示式
Print Month(DateSerial(1994, 12, 20))
錯誤代碼
5 無效的程序呼叫
範例:
MsgBox "" & Month(Now) ,64,"The current month"
End sub