View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default get week day of a date

this should do it, i used a1 for the date and b1 for the result

Sub test()
Range("b1").Value = Weekday(Range("a1"))
End Sub

just for reference, if you wanted monday for the first day of the week, then you
would use this and the value would be 5

Range("b1").Value = Weekday(Range("a1"), vbMonday)
--


Gary


"ashishprem" wrote in
message ...

Hi All,
I want some help regarding date function in macro. I want to know the
week day number of the date. For eg on 30/12/2005 its Friday. I want the
week day number. For eg Sunday -1 ,Monday -2 .... Friday -6 Saturday -
7.
For 30/12/2005, the result will be 6. Is there any function to get the
week day number?

Regards
Ashish


--
ashishprem
------------------------------------------------------------------------
ashishprem's Profile:
http://www.excelforum.com/member.php...o&userid=31485
View this thread: http://www.excelforum.com/showthread...hreadid=532162