Minggu, 15 Januari 2012

Re: [ExcelVBA] Detecting INVALID dates?

 

From a quick check, Excel doesn't treat date strings with invalid day or
month numbers as dates, it leaves them as strings. As such, they should be
visible on the screen (left-justified, rather than right-justified) and
would probably also fail "is number" types of tests.

Your 1705 will be the complication, though. Certainly, you'd need to
substitute an appropriate year to keep leap-year checking intact.

Regards, Dave S

----- Original Message -----
From: "Robert E. Carneal" <kentuckygenealogist@gmail.com>
To: "excelvba" <excelvba@yahoogroups.com>
Sent: Monday, January 16, 2012 8:32 AM
Subject: [ExcelVBA] Detecting INVALID dates?

> *Obviously, a date such as Feb. 31, 1705 cannot be correct. Can I have
> Excel "detect" invalid dates? Unfortunately, yes, most are before 1900. I
> just read XDATE information hoping to see a way to utilize XDATE into
> checking for a valid date, but didn't see one.
>
> Invalid dates play havoc on date calculations, so if I can detect it
> before
> calculation, I can force the user to enter a correct date.
> *
> *Thank you.
>
> **Robert*
> *Genealogy without documentation is mythology! Always SOURCE your work.*
>
>
> [Non-text portions of this message have been removed]
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
> here: http://www.mousetrax.com/techtrax to enter the ezine, then search
> the ARCHIVES for EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 10.0.1416 / Virus Database: 2109/4144 - Release Date: 01/15/12
>

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar