Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default 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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Retrieve data for previous 3, 6, 12 month given current month GB Excel Worksheet Functions 4 July 19th 07 11:58 PM
Create Month Timetable on a worksheet different month each works Courtney Excel Worksheet Functions 1 October 15th 06 11:48 AM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 08:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"