K
Kenneth
I want to write a VBA to extract certain data in MS Word documents and copy
to an Excel document. Inside the Word document there are dates of the form
"dd/mm/yyyy", and I cannot tell anything about the date format setting of
the local machine.
Now I can't get the conversion done correctly when both date and month are
<= 12.
Could somebody give me some suggestion? Thanks.
My VBA code (extracted):
Dim dateString Ds string
Dim xlWks As Excel.Worksheet
// ...
dateString = "02/05/2006" ' 2 May 2006
xlWks.Cells(1, 1).FormulaR1C1 = dateString ' The date value in Excel
became 5 Feb 2006
to an Excel document. Inside the Word document there are dates of the form
"dd/mm/yyyy", and I cannot tell anything about the date format setting of
the local machine.
Now I can't get the conversion done correctly when both date and month are
<= 12.
Could somebody give me some suggestion? Thanks.
My VBA code (extracted):
Dim dateString Ds string
Dim xlWks As Excel.Worksheet
// ...
dateString = "02/05/2006" ' 2 May 2006
xlWks.Cells(1, 1).FormulaR1C1 = dateString ' The date value in Excel
became 5 Feb 2006