Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Day of the Week from Date

Hi,

I need to work out what day of the week it is from a date value. I know you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,646
Default Day of the Week from Date

yourvariable =Worksheetfunction.TEXT(A1;"dddd")

where A1 contains the date value.

Regards,
Stefi

€žGreg Billinge€ ezt Ă*rta:

Hi,

I need to work out what day of the week it is from a date value. I know you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Day of the Week from Date

=TEXT(A1,"dddd")

--
HTH

Bob Phillips

"Greg Billinge" wrote in message
...
Hi,

I need to work out what day of the week it is from a date value. I know

you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Day of the Week from Date

try

Sub dodate()
myvar = Format(Range("g19"), "ddd")
MsgBox myvar
If myvar = "Fri" Then MsgBox "OK"
End Sub

or shortened

if Format(Range("g19"), "ddd")="Fri" then msgbox "OK"


--
Don Guillett
SalesAid Software

"Greg Billinge" wrote in message
...
Hi,

I need to work out what day of the week it is from a date value. I know

you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Day of the Week from Date

Hi Greg

Uppercase first letter and all:

Sub test()
Dim Dt As Date
Dim sDay As String

Dt = Date
sDay = StrConv(Format$(Dt, "dddd"), vbProperCase)

End Sub

Note that this, and the other provided solutions, returns day names based on
the computer's regional settings, so it'll say Vendredi in France, not
Friday.

HTH. Best wishes Harald


"Greg Billinge" skrev i melding
...
Hi,

I need to work out what day of the week it is from a date value. I know
you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 683
Default Day of the Week from Date

try using Excel's WEEKDAY function.

"Greg Billinge" wrote:

Hi,

I need to work out what day of the week it is from a date value. I know you
can show it in formatting but i need to set the value of a variable in my
macro to Monday, Tuesday etc.

Any help is really appreciated.

Thanks

Greg

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
Convert regular Date to Week Ending or Week Beginning Dates Sam H Excel Discussion (Misc queries) 5 April 3rd 23 04:39 PM
Display "this week" column headers w/date & day of week? Ivan Wiegand Excel Worksheet Functions 9 September 12th 07 05:18 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Finding the Monday date based on a different date in same week dandiehl Excel Worksheet Functions 4 April 11th 06 06:03 PM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM


All times are GMT +1. The time now is 11:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"