Return to VBA Code Examples

VBA Month Function

Month Description

Returns the month (a number from 1 to 12) given a date value.

Simple Month Examples

Here is a simple Month example:

This code will return 2.

Month Syntax

In the VBA Editor, you can type  “Month(” to see the syntax for the Month Function:

The Month function contains an argument:

Date: A valid date.

Examples of Excel VBA Month Function

Result: 5

Result: 8

Result: 11

Result will be the month of the current system date.

VBA Coding Made Easy

Stop searching for VBA code online. Learn more about AutoMacro - A VBA Code Builder that allows beginners to code procedures from scratch with minimal coding knowledge and with many time-saving features for all users! vba save as


Learn More!