Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel 2002, Win XP
I'm working with the new military 8 digit date system. For instance 20030704 is 4 July 2003. I need to check if the user entry is a valid date. I'm using: DateFrom8 = DateSerial(Left(j, 4), Mid(j, 5, 2), Right(j, 2)) to convert the 8 digits into the intended date. The conversion works fine. The problem is when I try to check if the user entered the 8 digits correctly. IOW, 13 months is bad, 32 days is bad. But the above DateSerial function will simply take the 13 months as being one month more than the date if 12 were entered. The same with too many days. No matter what the numbers entered, DateSerial will produce a valid date. Using IsDate(DateSerial(...........) will always produce a True. My question: Is there a function other than DateSerial that I can use with IsDate to show False if the user enters too many months or days? Or is there another way to check the validity of the date? Obviously I can check Mid(j, 5, 2) and see if it's 12. The problem is more with the days. Thanks for your help. Otto |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Checking Dates against Bank Holidays | Excel Worksheet Functions | |||
Spell Checking with checking cell notes | Excel Discussion (Misc queries) | |||
Importing dates and military time from Excel into word doc mail me | Excel Discussion (Misc queries) | |||
Sumproduct checking between two dates | Excel Worksheet Functions | |||
Military time comes up? | Excel Discussion (Misc queries) |