Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
Function WhatsTheDay(mnth As Integer, yr As Integer) As String
whatday = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
sorry:
Function WhatsTheDay(mnth As Integer, yr As Integer) As String WhatsTheDay = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 "Gary''s Student" wrote: Function WhatsTheDay(mnth As Integer, yr As Integer) As String whatday = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
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! "Gary''s Student" wrote: sorry: Function WhatsTheDay(mnth As Integer, yr As Integer) As String WhatsTheDay = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 "Gary''s Student" wrote: Function WhatsTheDay(mnth As Integer, yr As Integer) As String whatday = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
You are very welcome.
Have a pleasant day! -- Gary''s Student - gsnu200778 "NateBuckley" wrote: 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! "Gary''s Student" wrote: sorry: Function WhatsTheDay(mnth As Integer, yr As Integer) As String WhatsTheDay = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 "Gary''s Student" wrote: Function WhatsTheDay(mnth As Integer, yr As Integer) As String whatday = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Working out the start day, for a particular month and year
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 "Gary''s Student" wrote in message ... sorry: Function WhatsTheDay(mnth As Integer, yr As Integer) As String WhatsTheDay = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 "Gary''s Student" wrote: Function WhatsTheDay(mnth As Integer, yr As Integer) As String whatday = Format(DateSerial(yr, mnth, 1), "dddd") End Function -- Gary''s Student - gsnu200778 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
NPV - when does the first year start? | Excel Worksheet Functions | |||
count month when date is in day/month/year format | Excel Worksheet Functions | |||
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? | Excel Discussion (Misc queries) | |||
trying to get day/month/year froamt while user enters year only | New Users to Excel | |||
Formula to return last day of month for each month in year? | Excel Programming |