Easier date entry

  • Thread starter Thread starter Beesht
  • Start date Start date
B

Beesht

I have a date column with the format dd/mm/yy.
Is there away to just enter the numbers with the / being entered
automatically.
Thanks
 
Beesht,

If Column 1 contains your dates, then try the following:

It forces you to use the ddmmyy convention for data entry.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Application.EnableEvents = False
Target.Value = CDate(Format(CLng(Target.Value), "00""/""00""/""00"))
Application.EnableEvents = True
End If
End Sub

You could make it smarter by validating dates within a range (1986 to 2009)
and anything else is ddmmyy format - though I wouldn't recommend it.

Rob
 
Back
Top