Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
NPV - when does the first year start? Gazza Excel Worksheet Functions 3 July 12th 09 09:35 PM
count month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Tell me which "season" (Month/Day through Month/Day) a date(Month/Day/Year) falls in (any year)??? misscrf Excel Discussion (Misc queries) 1 December 14th 07 02:59 PM
trying to get day/month/year froamt while user enters year only RADIOOZ New Users to Excel 3 June 7th 06 05:30 AM
Formula to return last day of month for each month in year? StargateFan[_3_] Excel Programming 5 January 3rd 06 04:05 AM


All times are GMT +1. The time now is 08:51 PM.

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"