ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Date Format Macro (https://www.excelbanter.com/excel-programming/419790-excel-date-format-macro.html)

nicole3208

Excel Date Format Macro
 
Does anyone have or know where I can get a macro that will allow me to enter
a date for example as 112808 then "enter" and have excel format it as
11/28/08? (using a MM/DD/YY format)

Bernard Liengme

Excel Date Format Macro
 
You would need an On_Change worksheet macro but there are other options:
1) after entering a number of values in your 112808 format, select the range
and use Data | TextToColumn to convert to dates -- notes there is an option
for this in the third step when you use Delimited (rather than Fixed Length)
2) enter your numbers in one column (say A) and use a helper column to
convert to dates with =DATE(RIGHT(A1,2)+100,LEFT(A1,2),MID(A1,3,2))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"nicole3208" wrote in message
...
Does anyone have or know where I can get a macro that will allow me to
enter
a date for example as 112808 then "enter" and have excel format it as
11/28/08? (using a MM/DD/YY format)




Don Guillett

Excel Date Format Macro
 
Here is one I am using for time entered 0820 or 1528, etc
Right click sheet tabview codecopy/pastemodify to suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Intersect(Target, Columns("c")) Is Nothing Then Exit Sub
Application.EnableEvents = False
Target.Value = Format(Target, "00:00")
Target.NumberFormat = "hh:mm"
Application.EnableEvents = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"nicole3208" wrote in message
...
Does anyone have or know where I can get a macro that will allow me to
enter
a date for example as 112808 then "enter" and have excel format it as
11/28/08? (using a MM/DD/YY format)



Ron de Bruin

Excel Date Format Macro
 
Hi nicole3208

See also
http://www.xldynamic.com/source/xld.QDEDownload.html

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"nicole3208" wrote in message ...
Does anyone have or know where I can get a macro that will allow me to enter
a date for example as 112808 then "enter" and have excel format it as
11/28/08? (using a MM/DD/YY format)



All times are GMT +1. The time now is 03:38 PM.

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