Return last day of next month
This tutorial shows how to return the last day of the next month, from he current month, using an Excel formula or VBA
Example: Return last day of a current month
=EOMONTH(NOW(),1)
|
This formula uses the Excel EOMONTH and NOW functions to calculate the last day of a current month. Using the NOW function inside the EOMONTH function, with the months criteria of 1, will return the last day in the next month, in date format, from the current date.
|
Sub Last_Days_of_Next_Month()
'declare a variable
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'return the last day in a current month
ws.Range("D5") = Application.WorksheetFunction.EoMonth(Now(), 1)
ws.Range("D5") = Application.WorksheetFunction.EoMonth(Now(), 1)
End Sub
ADJUSTABLE PARAMETERS
Output Range: Select the output range by changing the cell reference ("D5") in the VBA code.
Output Range: Select the output range by changing the cell reference ("D5") in the VBA code.
EXPLANATION
This tutorial shows how to get the last day of the next month through the use of an Excel formula or VBA.
Both the Excel formula and VBA methods make use of the EOMONTH and NOW functions, with a month criteria of 1, to return the last day of the next month.
FORMULA
=EOMONTH(NOW(),1)
=EOMONTH(NOW(),1)
RELATED TOPICS
Related Topic | Description | Related Topic and Description |
---|---|---|
Return last day of a current month | How to return the last day of a current month using Excel and VBA | |
Return number of days in a current month | How to return the number of days in a current month using Excel and VBA | |
Return number of days in a month | How to return the number of days in a specific month using Excel and VBA | |
Return previous month based on current month | How to return the previous month based on the current month using Excel and VBA | |
Return next month based on current month | How to return the next month based on the current month using Excel and VBA |
RELATED FUNCTIONS
Related Functions | Description | Related Functions and Description |
---|---|---|
NOW Function | The Excel NOW function returns the current date and time |