View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default How to list dates in a month of particular weekday

Here is a much shorter function to do what the function at the link does...

Function NthWeekday(DateIn As Date, Nth As Long, DOW As Long) As Date
NthWeekday = DateSerial(Year(DateIn), Month(DateIn), 1 + 7 * Nth) - _
Weekday(DateSerial(Year(DateIn), Month(DateIn), 8 - DOW))
End Function

This function is just the general formula I posted elsewhere in this thread
converted to a one-liner VB statement.

--
Rick (MVP - Excel)


"Jeff" wrote in message
...
MSDN has a good exaple of finding a day
http://msdn.microsoft.com/en-us/libr...32(VS.60).aspx

"MasterDragon" wrote:

MY question is simple, sorry if i'm being stupid.

Can anyone tell me how can i make a list which contains only dates of all
the Fridays in a particular month?

In a more advanced sense, can I create a list with all the Fridays AND
Saturdays of a month?