Working out the start day, for a particular month and year

  • Thread starter Thread starter NateBuckley
  • Start date Start date
N

NateBuckley

Hello everyone,

A little bit stuck, I'm just wondering if anyone knows a way how I'd be able
to work out the 1st Day of a particular month, of a particular year.

So If I did the following

aString = WhatsTheDay(1, 2010)

the function "WhatsTheDay" would return "Fri" or "Friday"

Thanks for any help in advance!
 
Function WhatsTheDay(mnth As Integer, yr As Integer) As String
whatday = Format(DateSerial(yr, mnth, 1), "dddd")
End Function
 
sorry:

Function WhatsTheDay(mnth As Integer, yr As Integer) As String
WhatsTheDay = Format(DateSerial(yr, mnth, 1), "dddd")
End Function
 
You sir, deserve a Pint of cold beer.

Thank you so much, I've been looking at a lot more complicated examples. I
feel a bit of a dummy now.

Thanks again!
 
Just as a follow up.... if one doesn't, or doesn't want to, remember the
"dddd" argument, there is an alternative set of formulas available.

Function WhatsTheDay(mnth As Integer, yr As Integer) As String
WhatsTheDay = WeekdayName(Weekday(DateSerial(yr, mnth, 1)))
End Function

Rick
 

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

Back
Top