Month 函数

Month 函数

返回一个 Variant (Integer),其值为 1 到 12 之间的整数,表示一年中的某月。

语法

Month(date) 

必要的 date 参数,可以是任何能够表示日期的 Variant数值表达式字符串表达式或它们的组合。如果 date 包含 Null,则返回 Null

 

其实就是把日期表达式中的月数提取出来

实例:

1 Sub 几月份()
2 Cells(1) = Month(Date)
3 End Sub

 

 

原文地址:https://www.cnblogs.com/gongyanxu/p/8639277.html