Thread: Date Validation
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Franz Erhart Franz Erhart is offline
external usenet poster
 
Posts: 18
Default 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!!