Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have an Excel macro that checks a document property which is a date. I am checking a given date, which, if set, triggers a given processing. How can I design my if statement so that the check is always working regardless of the locale of the user running Excel, i.e. if I want to check if the date is equal to the 15th of August 2005, how should my if statement look like ? Thanks for help Balex |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if cdate(stringvariable) = DateValue("August 15, 2005") then
-- Regards, Tom Ogilvy "Balex" wrote in message ... Hi, I have an Excel macro that checks a document property which is a date. I am checking a given date, which, if set, triggers a given processing. How can I design my if statement so that the check is always working regardless of the locale of the user running Excel, i.e. if I want to check if the date is equal to the 15th of August 2005, how should my if statement look like ? Thanks for help Balex |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Balex
Try..... Dim d as Date d=DateSerial(2005,8,15) If Date = d then 'Your Code here End If -- XL2003 Regards William "Balex" wrote in message ... Hi, I have an Excel macro that checks a document property which is a date. I am checking a given date, which, if set, triggers a given processing. How can I design my if statement so that the check is always working regardless of the locale of the user running Excel, i.e. if I want to check if the date is equal to the 15th of August 2005, how should my if statement look like ? Thanks for help Balex |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If CDate(mydatestring) = #2005-08-15# Then
... -- HTH Bob Phillips "Balex" wrote in message ... Hi, I have an Excel macro that checks a document property which is a date. I am checking a given date, which, if set, triggers a given processing. How can I design my if statement so that the check is always working regardless of the locale of the user running Excel, i.e. if I want to check if the date is equal to the 15th of August 2005, how should my if statement look like ? Thanks for help Balex |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
permanent conversion of 1904 date format to 1900 date format | Excel Worksheet Functions | |||
Normalizing to neutral time period | Excel Discussion (Misc queries) | |||
Convert european foreign date format to US date format | Excel Worksheet Functions | |||
code to convert date from TEXT format (03-02) to DATE format (200203) | Excel Programming | |||
Change a date in text format xx.xx.20xx to a recognised date format | Excel Programming |