View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Incorrect results of Weekdayname(Weekday... function???

Weekday returns a number, but weekdayname is looking for a date.

Weekdayname(DateValue("05/26/2004"))

or
Weekdayname(#05/26/2004#)

In VBA you should keep your date strings in mm/dd/yyyy format.

--
Regards,
Tom Ogilvy


"Kobayashi " wrote in message
...
I'm trying to determine the day of the week for a date, which will then
be used in an IF argument. However, when I put the following in the
debug pane I get 'Thursday' as the result, when clearly today is
Wednesday!???

I'm actually using a variable which contains the date of "26/05/2004",
but this doesn't work either?

I'm using Excel 2000 with UK regional settings.

?weekdayname(weekday("02/06/2004"))

I'm sure this is going to be something very simple and slightly
embarassing for me when resolved but help would be appreciated!

Very confused!

Adrian


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