![]() |
Text Dates with 2 Digit Year
Data I copy from someone else's worksheets as part of a macro routine I've
developed include many cells containing text dates with 2 digit years. Excel flags these cells, and allows me to fix the "errors"... Ijust select the "Convert XX to 20XX" option and all is fine. Does someone know I way I can perform this conversion from within a macro? For now I've split my macro into two... I let the 1st macro stop with all the affected cells selected at which time I manually do all the conversions as above, and then start a 2nd macro... but that's definitely less than desireable... Thanks in advance !! |
Text Dates with 2 Digit Year
Fogcity wrote: Data I copy from someone else's worksheets as part of a macro routine I've developed include many cells containing text dates with 2 digit years. Excel flags these cells, and allows me to fix the "errors"... Ijust select the "Convert XX to 20XX" option and all is fine. Does someone know I way I can perform this conversion from within a macro? For now I've split my macro into two... I let the 1st macro stop with all the affected cells selected at which time I manually do all the conversions as above, and then start a 2nd macro... but that's definitely less than desireable... Thanks in advance !! what is the current format of the date mm/dd/yy or mmddyy or mm-dd-yy or something else? |
Text Dates with 2 Digit Year
It is dd-mmm-yy.
"stevebriz" wrote: Fogcity wrote: Data I copy from someone else's worksheets as part of a macro routine I've developed include many cells containing text dates with 2 digit years. Excel flags these cells, and allows me to fix the "errors"... Ijust select the "Convert XX to 20XX" option and all is fine. Does someone know I way I can perform this conversion from within a macro? For now I've split my macro into two... I let the 1st macro stop with all the affected cells selected at which time I manually do all the conversions as above, and then start a 2nd macro... but that's definitely less than desireable... Thanks in advance !! what is the current format of the date mm/dd/yy or mmddyy or mm-dd-yy or something else? |
Text Dates with 2 Digit Year
try this
i used B27 as my test cell Dim strDate As String Dim formdate As Date formdate = Range("B27").Value strDate = Format(formdate, "dd -mmm-yyyy") MsgBox strDate |
All times are GMT +1. The time now is 03:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com