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

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

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default checking what day a date is?

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


neowok wrote:

if i have a date say 12-jun-04 is there an easy to to say something like
if this date = a monday then .... if it = tuesday then... etc


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default checking what day a date is?

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

"neowok " wrote in message
...
if i have a date say 12-jun-04 is there an easy to to say something like
if this date = a monday then .... if it = tuesday then... etc


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default checking what day a date is?

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

"neowok " wrote in message
...
if i have a date say 12-jun-04 is there an easy to to say something like
if this date = a monday then .... if it = tuesday then... etc


---
Message posted from http://www.ExcelForum.com/



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default checking what day a date is?

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" wrote:

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

"neowok " wrote in message
...
if i have a date say 12-jun-04 is there an easy to to say something
like if this date = a monday then .... if it = tuesday then... etc


---
Message posted from http://www.ExcelForum.com/






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default checking what day a date is?

KeepITCool,

That's right ! Better that way.

Leer ik WEER wat van je ;-)

"keepITcool" wrote in message
...
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" wrote:

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

"neowok " wrote in message
...
if i have a date say 12-jun-04 is there an easy to to say something
like if this date = a monday then .... if it = tuesday then... etc


---
Message posted from http://www.ExcelForum.com/






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
Checking a date/number between two others [email protected] Excel Discussion (Misc queries) 6 March 31st 09 12:01 AM
Color Code Date Checking drvortex Excel Worksheet Functions 3 February 1st 06 07:34 AM
Put todays date in a cell by checking a box!! Martin Excel Discussion (Misc queries) 1 October 24th 05 09:01 PM
Help with Date checking code Mr. Clean[_2_] Excel Programming 2 February 20th 04 03:24 PM
Checking for valid date Paul M.[_3_] Excel Programming 4 December 1st 03 07:25 PM


All times are GMT +1. The time now is 05:06 PM.

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

About Us

"It's about Microsoft Excel"