Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Validating Date Format

Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.

Thank You
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default Validating Date Format

Hi,

Why not just format the whole column to the desired format, then any dates
legal dates must be formatted as you want?

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"exceed_novice" wrote:

Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.

Thank You

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,480
Default Validating Date Format

Hi

Format the column FormatcellsNumberCustommm/dd/yyyy
Select the columnDataText to columnsNextNextselect Dateselect
M/D/YFinish

--
Regards
Roger Govier

"exceed_novice" wrote in message
...
Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.

Thank You


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,389
Default Validating Date Format

It depends on what data you have. Is there a reason you couldn't provide
examples, and tell what what you tried and why it doesn't work? For example,
did you try Excel's Datevalue function?

And remember, no amount of validation can determine that 12/01/2009 should
really be Jan 12/09.

Regards,
Fred


"exceed_novice" wrote in message
...
Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.

Thank You


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Validating Date Format

This will work even if your dates are text strings, which formatting as a date will not correct.
Copy the code into a regular codemodule, and use it like

=CheckDate(A2,"mm/dd/yyyy")

Copy down to match your cells.

HTH,
Bernie
MS Excel MVP


Function CheckDate(myC As Range, myF As String) As Variant
CheckDate = (myC.Text = Format(myC.Value, myF))
End Function


"exceed_novice" wrote in message
...
Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.

Thank You





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Validating Date Format

Thanks to allof you fo rthe responses. I will try them out.

On Feb 6, 9:04*pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
This will work even if your dates are text strings, which formatting as a date will not correct.
Copy the code into a regular codemodule, and use it like

=CheckDate(A2,"mm/dd/yyyy")

Copy down to match your cells.

HTH,
Bernie
MS Excel MVP

Function CheckDate(myC As Range, myF As String) As Variant
CheckDate = (myC.Text = Format(myC.Value, myF))
End Function

"exceed_novice" wrote in message

...

Hi,
We receive a sheet with about 1000 rows and need to do some
validation
on that sheet before it gets processed. One of the validations is for
the column with the date.
I need to validate that the date is in the "mm/dd/yyyy" format. I
have
looked and tried different but have not been able to do this. Could
somebody tell me how to validate the date.


Thank You


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
convert serial date format to normal date format Flagworld Excel Discussion (Misc queries) 3 September 23rd 08 01:32 PM
validating format oldLearner57 Excel Discussion (Misc queries) 2 June 16th 08 07:09 PM
validating telephone format Theo Excel Worksheet Functions 6 February 12th 08 02:15 AM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
Validating a date field kenelder Excel Discussion (Misc queries) 2 February 16th 05 10:50 PM


All times are GMT +1. The time now is 06:28 AM.

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"