Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 !! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatically convert Text with 2-digit year | Excel Discussion (Misc queries) | |||
Convert dates to 8 digit text | Excel Discussion (Misc queries) | |||
Addendum to 2 digit year to 4 digit year | Excel Discussion (Misc queries) | |||
Format 2 digit year to 4 digit | Excel Discussion (Misc queries) | |||
2 digit year in dates return 19xx not 20xx | Excel Discussion (Misc queries) |