Last day of month is saturday or sunday?

G

Guest

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!
 
R

Rick Rothstein \(MVP - VB\)

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top