Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Seeing as VBA doesnt handle non-US date formats in this instance, and taking
up ward376's suggestion, I will use the following: Dim RecordCounter As Long ' Number of Records to be Processed RecordCounter = 15 ' Including Header ' Reformat dd.MM.yy dates in column F into dd/MM/yyyy Excel dates in column C via column E Range("F1").Copy Destination:=Range("E1") ' Copy Header Dim i As Long For i = 2 To RecordCounter ' Fill in with Excel formulae Range("E" & i).FormulaR1C1 = _ "=DATEVALUE(CONCATENATE(LEFT(RC[1],FIND(""."",RC[1])-1),""/"",MID(RC[1],(FIND(""."",RC[1])+1),((FIND(""."",RC[1],(FIND(""."",RC[1])+1))-(FIND(""."",RC[1])+1)))),""/"",RIGHT(RC[1],LEN(RC[1])-FIND(""."",RC[1],FIND(""."",RC[1])+1))))" Next i Columns("E:E").NumberFormat = "dd/mm/yyyy;@" ' Format the column Columns("E:E").Copy ' Copy Values (lose the formulae) and Formats Columns("C:C").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False Columns("C:C").PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, SkipBlanks:=False, Transpose:=False It's a bit "intense" but it does the job. Thanks for all your help. Paul J |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
convert text "20100315" to date format | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
how i convert "100" to "hundred"( number to text) in excel-2007 | Excel Worksheet Functions | |||
Convert text "date" (DDMMMYY) to datetime value of YYYY-MM-DD - ho | Excel Discussion (Misc queries) | |||
Option Explicit and Date Format "dd mmm yyyy"? | Excel Programming |