ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   End Of Month (https://www.excelbanter.com/excel-programming/326140-end-month.html)

pete

End Of Month
 
How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete


Ron de Bruin

End Of Month
 
Try this Pete

If Month(Date) < Month(Date + 1) Then MsgBox "This is the last day"


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Pete" wrote in message ...
How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete




Fredrik Wahlgren

End Of Month
 

"Pete" wrote in message
...
How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete


Assuming you have a date in A1, you could use this formula

=IF(A1=DATE(YEAR(A1),1+MONTH(A1),0), TRUE, FALSE)

I got the idea from http://www.mrexcel.com/td0053.html

/Fredrik



Daniel.M

End Of Month
 
Hi,

If you want to verify that today is the end of the month

If Day(Date+1) = 1 Then Msgbox "End of Month"

Replace Date with any other variable, should you need to.

Regards,

Daniel M.

"Pete" wrote in message
...
How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete




Stratuser

End Of Month
 

Monthend = Application.Run("ATPVBAEN.XLA!EOMONTH", Range("daterange").Value,
1)

"Pete" wrote:

How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete



Myrna Larson

End Of Month
 
And if you set a reference to the ATP in the VBE (Tools/References, check
ATPVBA), you can write it as

MonthEnd = EOMONTH(Range("DateRange").Value)



On Fri, 25 Mar 2005 13:55:02 -0800, Stratuser
wrote:


Monthend = Application.Run("ATPVBAEN.XLA!EOMONTH", Range("daterange").Value,
1)

"Pete" wrote:

How can I detect if the End Of the month has been reached
from within VBA

I know you can use EOMONTH in Excel, is it available in
VBA?

Pete





All times are GMT +1. The time now is 02:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com