Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reccognize what day is it ?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reccognize what day is it ?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reccognize what day is it ?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reccognize what day is it ?


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default how to reccognize what day is it ?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default how to reccognize what day is it ?


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
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



All times are GMT +1. The time now is 11:36 PM.

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"