ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Validation (https://www.excelbanter.com/excel-programming/412695-date-validation.html)

Yossy

Date Validation
 
Please I have thousands of rows across multiple columns. I need to validate
date in m/d/yyyy format. Coding will really help me as I use some formula
that does not help across multiple date. If possible to color any date not in
the m/d/yyyy format.

Sometimes I get error like d/m/yyyy or m/d//yyyy or d//m/yy or sept 2000.
Please help me be able to identify these date problem. Its really making me
get so many error files.

Thanks a big bunch!!

Franz Erhart

Date Validation
 
I'd do it this way:
1) start macro recording
2) got to format | conditional formating and enter
- cellvalue not between 1.1.1950 and 1.1.2000, colour red -- ok
3) stop macro editor und check the produced code - in my case:

Sub Makro1()
'
' Makro1 Makro
' Makro am 17.06.2008 von Franz Erhart aufgezeichnet
'

'
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue,
Operator:=xlNotBetween, _
Formula1:="18264", Formula2:="36526"
Selection.FormatConditions(1).Font.ColorIndex = 3
End Sub

4) adapt und use this piece of code in your program as needed

regards
franz erhart.



"Yossy" wrote:

Please I have thousands of rows across multiple columns. I need to validate
date in m/d/yyyy format. Coding will really help me as I use some formula
that does not help across multiple date. If possible to color any date not in
the m/d/yyyy format.

Sometimes I get error like d/m/yyyy or m/d//yyyy or d//m/yy or sept 2000.
Please help me be able to identify these date problem. Its really making me
get so many error files.

Thanks a big bunch!!



All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com