Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
get the day of week from a date
Hi, I am using a variable to hold the day of the week for a given day Dim DayOfWeek As Date DayOfWeek = ThisWorkbook.Sheets("Menu").Range("D2").Value If the value of this cell is a date, how can I have the variable hold the name of the day of the week? I want to use this to add the day name to a filename ie Monday Report.xls. Any ideas? Kind regards, Matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
get the day of week from a date
DayOfWeek = Format(ThisWorkbook.Sheets("Menu").Range("D2").Val ue,"dddd")
-- __________________________________ HTH Bob "MJKelly" wrote in message ... Hi, I am using a variable to hold the day of the week for a given day Dim DayOfWeek As Date DayOfWeek = ThisWorkbook.Sheets("Menu").Range("D2").Value If the value of this cell is a date, how can I have the variable hold the name of the day of the week? I want to use this to add the day name to a filename ie Monday Report.xls. Any ideas? Kind regards, Matt |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
get the day of week from a date
Hi,
Try this Dim DayOfWeek As String DayOfWeek = WeekdayName(Weekday(ThisWorkbook.Sheets("Menu").Ra nge("D2").Value)) Mike "MJKelly" wrote: Hi, I am using a variable to hold the day of the week for a given day Dim DayOfWeek As Date DayOfWeek = ThisWorkbook.Sheets("Menu").Range("D2").Value If the value of this cell is a date, how can I have the variable hold the name of the day of the week? I want to use this to add the day name to a filename ie Monday Report.xls. Any ideas? Kind regards, Matt |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
get the day of week from a date
I forgot the other arguments
DayOfWeek = WeekdayName(Weekday(ThisWorkbook.Sheets("Menu").Ra nge("D2").Value), 0, 1) Mike "Mike H" wrote: Hi, Try this Dim DayOfWeek As String DayOfWeek = WeekdayName(Weekday(ThisWorkbook.Sheets("Menu").Ra nge("D2").Value)) Mike "MJKelly" wrote: Hi, I am using a variable to hold the day of the week for a given day Dim DayOfWeek As Date DayOfWeek = ThisWorkbook.Sheets("Menu").Range("D2").Value If the value of this cell is a date, how can I have the variable hold the name of the day of the week? I want to use this to add the day name to a filename ie Monday Report.xls. Any ideas? Kind regards, Matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Convert regular Date to Week Ending or Week Beginning Dates | Excel Discussion (Misc queries) | |||
Display "this week" column headers w/date & day of week? | Excel Worksheet Functions | |||
Check if Date within this week/last week | Excel Programming | |||
Date Function formula that will return the date of a specific week | Excel Worksheet Functions | |||
I need week number in excell from a date, first week must be mini. | Excel Discussion (Misc queries) |