Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Last day of month is saturday or sunday?

Hi! I have a macro that loops through a series of dates and perfoms
calculations for these dates. I skip saturdays and sundays. However if the
last day of any month is saturday or sunday then i want to perform a
calculation. How can I check if a date is the last day of a month? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default Last day of month is saturday or sunday?

Try testing your date this way...

If YourDate = DateSerial(Year(YourDate), Month(YourDate) + 1, 0) Then
' YourDate is the last day of the month
End If

Rick

"Arne Hegefors" wrote in message
...
Hi! I have a macro that loops through a series of dates and perfoms
calculations for these dates. I skip saturdays and sundays. However if the
last day of any month is saturday or sunday then i want to perform a
calculation. How can I check if a date is the last day of a month? Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Last day of month is saturday or sunday?

If Month(test_Date) < Month(test_Date + 1) Then
'last day of month

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Arne Hegefors" wrote in message
...
Hi! I have a macro that loops through a series of dates and perfoms
calculations for these dates. I skip saturdays and sundays. However if the
last day of any month is saturday or sunday then i want to perform a
calculation. How can I check if a date is the last day of a month? Thanks!



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
conditional formatting of Saturday/Sunday in calendar Valorie Excel Discussion (Misc queries) 2 August 28th 09 05:29 PM
Friday as weekend instead of Saturday & Sunday Naushad Excel Worksheet Functions 3 March 14th 09 08:22 AM
I want to set weekly off as Thursday instead of Saturday & Sunday Porwal P K Excel Worksheet Functions 1 June 27th 08 05:48 PM
NETWORKDAYS including Saturday and Sunday Sherry Excel Discussion (Misc queries) 2 May 15th 08 11:06 PM
Is there a way to identify saturday and sunday automatically Unicornlmb Excel Discussion (Misc queries) 2 January 5th 06 05:34 PM


All times are GMT +1. The time now is 05:39 AM.

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"