View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_4_] Bob Phillips[_4_] is offline
external usenet poster
 
Posts: 834
Default Weekday function

Aah yes, I recall seeing that once now you mention, just never had cause to
use it.

Bob

"Robert Crandal" wrote in message
...
I just found out that VBA does actually provide a function of it's
own. It is called "WeekdayName()"

It works as follows:

WeekdayName(1) == returns "Sunday"
WeekdayName(1) == returns "Sunday"
WeekdayName(1) == returns "Sunday"
WeekdayName(1) == returns "Sunday"
WeekdayName(1) == returns "Sunday"
WeekdayName(1) == returns "Sunday"


"Bob Phillips" wrote in message
...
Don't think so, you would need to write one

Function MyWeekDay(DayNum As Long) As String
Dim Days As Variant

MyWeekDay = Format(Date - (Weekday(Date) - 2) + DayNum - 2, "ddd")
End Function