Function Dates Times Class

WeekdayToString

"Weekday Number To Name" or "Weekday Name From Number" Convert a number representing a day of the week into the name of the day. Accepts one of the vb constant values which represent the days of the week.

Signature (Visual Basic / VBA)

Public Function WeekdayToString( _
    ByVal vDayOfWeek As Variant _
    ) As Variant

Code Example

    Format$(#4/1/1996#, "ddd") = "Mon"
    WeekdayToString(#4/1/1996#) = "Monday"
    WeekdayToString(#4/2/1996#) = "Tuesday"
    WeekdayToString(vbFriday) = "Friday"

Parameters

Parameter Description
vDayOfWeek The date or numeric value whose weekday name is returned. Function returns Null if vDayOfWeek is Null or cannot be fixed up to either a date or a number. Function first checks numeric values to see if they are one of the vb constants that represent the days of the week (vbSunday, vbMonday, vbTuesday, vbWednesday, vbThursday, vbFriday, or vbSaturday). Otherwise, numeric values are interpreted as date values. Function examines the date component of date/time values to determine its weekday.