checking what day a date is?

  • Thread starter Thread starter neowok
  • Start date Start date
N

neowok

if i have a date say 12-jun-04 is there an easy to to say something lik
if this date = a monday then .... if it = tuesday then... et
 
i think this question belongs in excel.worksheetfunctions

if it's indeed a vba question:

select case weekday(MyDate,vbMonday)
case vbSunday
goto Football
case vbMonday
goto Work
case vbSaturday
goto Shopping
end select


keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 
Hi !

I assume you want to check the day in VBA, not in an Excel formula.

You can use format(Date,"dddd") to give you the name of the day (or "ddd"
for the abbreviated day notation)
Example: format(Now,"dddd") returns Thursday, format(Now,"ddd") returns Th

Good Luck
 
Hi !

I assume you want to check the day in VBA, not in an Excel formula.

You can use format(Date,"dddd") to give you the name of the day (or "ddd"
for the abbreviated day notation)
Example: format(Now,"dddd") returns Thursday, format(Now,"ddd") returns Th

Good Luck
 
Binzelli..

your solutions works, BUT using Format(date,"ddd") will give a localized
string... which might be a problem if you have users with different NLS
settings..

(beter zo ;-)

keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >


Binzelli said:
Hi !

I assume you want to check the day in VBA, not in an Excel formula.

You can use format(Date,"dddd") to give you the name of the day (or
"ddd" for the abbreviated day notation)
Example: format(Now,"dddd") returns Thursday, format(Now,"ddd")
returns Th

Good Luck
 
KeepITCool,

That's right ! Better that way.

Leer ik WEER wat van je ;-)

keepITcool said:
Binzelli..

your solutions works, BUT using Format(date,"ddd") will give a localized
string... which might be a problem if you have users with different NLS
settings..

(beter zo ;-)

keepITcool

< email : keepitcool chello nl (with @ and .) >
< homepage: http://members.chello.nl/keepitcool >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top