ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Easier date entry (https://www.excelbanter.com/excel-programming/289005-easier-date-entry.html)

Beesht[_5_]

Easier date entry
 
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


---
Message posted from http://www.ExcelForum.com/


Rob van Gelder[_4_]

Easier date entry
 
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


"Beesht " wrote in message
...
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


---
Message posted from http://www.ExcelForum.com/




Dave Peterson[_3_]

Easier date entry
 
Chip Pearson has some date (and time) entry code at:
http://www.cpearson.com/excel/DateTimeEntry.htm

In fact, you may want to read about how excel treats dates and times:
http://www.cpearson.com/excel/datetime.htm



"Beesht <" wrote:

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

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson



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

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