Month Function

DateSerial 또는 DateValue 함수를 사용하여 생성한 연속 날짜에서 월을 구합니다.

구문:

Month (Number)

반환 값:

Integer

매개 변수:

Number: 월을 결정하는 데 사용되는 연속 날짜 번호를 포함하는 숫자 식입니다.

이 함수는 DateSerial 함수와 반대입니다. 이 함수는 DateSerial 또는 DateValue가 생성한 연속 날짜에 해당하는 월을 구합니다. 예를 들어,

Print Month(DateSerial(1994, 12, 20))

값 12를 구합니다.

Error codes:

5 잘못된 프로시저 호출입니다.

예:

Sub ExampleMonth
    MsgBox "" & Month(Now) ,64,"The current month"
End Sub

Please support us!