What is VBA MONTH Function
how to use it
To use VBA's MONTH function you need to understand its syntax and arguments:
- Date: A valid date as per VBA from which you want to extract the month number.
Example to use MONTH Function in VBA
To practically understand how to use VBA MONTH function, you need to go through the below example where we have written a vba code by using it:
Sub example_MONTH() Range("B1").Value = Month(Range("A1")) End Sub
In the above example, we have used MONTH to get the year from the date which we have in the cell A1 and it has returned the 1 in the result as the date is the 1-Jan-2019.
About the Author
Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can ﬁnd him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.