Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim dt as Date
dt = DateValue("08-17-2006") Now if you want to calculate with the day of the week iday = weekday(dt) ' if you want to display Thursday sday = Format(dt,"dddd") ' Thursday or sday = Format(dt,"ddd") ' Thu demo'd from the immediate window: dt = DateValue("08-17-2006") ? weekday(dt) 5 ? format(dt,"dddd") Thursday ? format(dt,"ddd") Thu -- Regards, Tom Ogilvy "vumian" wrote: hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Vumian, I think this is what you're after. Sub chDate() rDate = "8-23-2006" MsgBox (Format(rDate, "dddd")) End Sub HTH Joe -- LFCFan ------------------------------------------------------------------------ LFCFan's Profile: http://www.excelforum.com/member.php...o&userid=37484 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MsgBox Format(myDate,"dddd")
where myDate is the date. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "vumian" wrote in message ... hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() oke thanks everyone i have a liitle question mo) i have a date range, from 1 to end of month, it is put per cell how to check what cell is sunday, and fill anycolo it ? use format formula ? how ? thanks one more -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() you can try using conditional formating Assuming that your data is in column A and that the cell actuall contains the entire date: Formula is =workday(a1)=7 and just Format Painter fill dow -- Bearacad ----------------------------------------------------------------------- Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501 View this thread: http://www.excelforum.com/showthread.php?threadid=57267 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
selection.Interior.ColorIndex = xlNone
for each cell in selection if weekday(cell,vbSunday) = 1 then cell.Interior.colorIndex = 4 end if Next -- Regards, Tom Ogilvy "vumian" wrote: oke thanks everyone i have a liitle question mo) i have a date range, from 1 to end of month, it is put per cell how to check what cell is sunday, and fill anycolo it ? use format formula ? how ? thanks one more -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One more if you're using xl2002 (xl2k???) or higher.
MsgBox WeekdayName(Weekday(Date)) WeekDayName was added in one of those versions. vumian wrote: hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 -- Dave Peterson |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to add Sunday start
WeekdayName(weekday(Date),,vbSunday) Although help says vbSunday is the default, WeekdayName(weekday(Date)) gives Friday for today (at least on my machine). -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Dave Peterson" wrote in message ... One more if you're using xl2002 (xl2k???) or higher. MsgBox WeekdayName(Weekday(Date)) WeekDayName was added in one of those versions. vumian wrote: hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 -- Dave Peterson |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm. Have you been playing with your pc date?
Option Explicit Sub testme() Debug.Print Date & "--" & WeekdayName(Weekday(Date)) End Sub 08/17/2006--Thursday ====== I don't have a guess why there would be a difference. Bob Phillips wrote: You need to add Sunday start WeekdayName(weekday(Date),,vbSunday) Although help says vbSunday is the default, WeekdayName(weekday(Date)) gives Friday for today (at least on my machine). -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Dave Peterson" wrote in message ... One more if you're using xl2002 (xl2k???) or higher. MsgBox WeekdayName(Weekday(Date)) WeekDayName was added in one of those versions. vumian wrote: hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 -- Dave Peterson -- Dave Peterson |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Absolutely not, I get Thursday by adding vbSunday. I get correct date, wrong
day. -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Dave Peterson" wrote in message ... Hmmm. Have you been playing with your pc date? Option Explicit Sub testme() Debug.Print Date & "--" & WeekdayName(Weekday(Date)) End Sub 08/17/2006--Thursday ====== I don't have a guess why there would be a difference. Bob Phillips wrote: You need to add Sunday start WeekdayName(weekday(Date),,vbSunday) Although help says vbSunday is the default, WeekdayName(weekday(Date)) gives Friday for today (at least on my machine). -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Dave Peterson" wrote in message ... One more if you're using xl2002 (xl2k???) or higher. MsgBox WeekdayName(Weekday(Date)) WeekDayName was added in one of those versions. vumian wrote: hi everyone, if i have date 08-23-2006, how to check it what day is it example: 08-17-2006, today is thursday thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 -- Dave Peterson -- Dave Peterson |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() hi everyone, hi, if i have a range from A1 to A31, which per date in per cell during month how to check from fisrt to end of month what is sunday (or other) and fill color it ? thanks in advance -- vumian ------------------------------------------------------------------------ vumian's Profile: http://www.excelforum.com/member.php...o&userid=36494 View this thread: http://www.excelforum.com/showthread...hreadid=572676 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|