LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default check for last day of month

On Wed, 26 Sep 2007 14:54:42 -0400, Ron Rosenfeld
wrote:

On Mon, 24 Sep 2007 13:58:00 -0700, pswanie
wrote:

i need a mocro to check if its the last day of the month and if so del
contents in cell a1


for example

chek if day = 31 then del range a1. if only 30 days in month then
chek if day = 30 then del range a1. if only 28 days in month then
chek if day = 28 then del range a1. if non of above then nothing

it can use the system date to chek what month is the current month




Sub ClearAtEOM()
If Day(Date + 1) < Day(Date) Then [a1].ClearContents
End Sub


--ron


I see JW has posted an even simpler method:

If Day(Date + 1) = 1 Then [a1].ClearContents


--ron
 
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
Check Input for Valid Month SLW612 Excel Programming 4 October 21st 07 08:27 PM
Last Saturday of each month(check on Monday) jimmy[_5_] Excel Programming 16 May 13th 07 12:45 AM
Check month jimmy[_5_] Excel Programming 10 March 4th 07 08:48 PM
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 03:23 PM.

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

About Us

"It's about Microsoft Excel"