drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and Thanks in Advance![/]
I have a column with dates and Times llike eg:
12/07/2011 12:19
13/07/2011 7:40
30/08/2011 8:44
the formatting is dd/mm/yyyy h:mm;@
and I have to take the Year, Month and Day from them 'CAN'T use formulas on the Sheet
'Remember this code is just for this web
At present I am using the following code:
In My Computer I get on the ActiveSheet:
yyyy mm dd
2011 7 12
2011 7 13
2011 8 30
so FINE.
But I my users computers they get:
yyyy mm dd
2011 12 7
2011 13 7
2011 30 8
so they get the Day instead of the month
And I don't know why
We are actually using the same workbook prepared for my to check what's wrong
DO I have to check country's code, language and/or???
What am I missing?
Thanks!
I have a column with dates and Times llike eg:
12/07/2011 12:19
13/07/2011 7:40
30/08/2011 8:44
the formatting is dd/mm/yyyy h:mm;@
and I have to take the Year, Month and Day from them 'CAN'T use formulas on the Sheet
'Remember this code is just for this web
At present I am using the following code:
Code:
Sub MACRO1()
On Error Resume Next: Application.ScreenUpdating = False
Dim rPT As Range: Set rPT = ActiveSheet.Range("A2:A500")
Dim aPT(): aPT = rPT.Value
Dim xRow As Long
Dim vBreakDate As Variant
Dim vBrakDateTime As Variant
'rPT.Cells(xRow, 1) = "12/07/2011 12:19"
'rPT.Cells(xRow, 2) = "13/07/2011 7:40"
'rPT.Cells(xRow, 3) = "30/08/2011 8:44"
For xRow = LBound(aPT, 1) To UBound(aPT, 1)
vBrakDateTime = Split(rPT.Cells(xRow, 1), " ")
' Date = vBrakDateTime(0)
' Time = vBrakDateTime(1)
vBreakDate = Split(vBrakDateTime(0), "/")
ActiveSheet.Cells(xRow , 4) = vBreakDate(2) 'YEAR ?????
ActiveSheet.Cells(xRow , 5) = vBreakDate(1) 'MONTH ????? in my computer Works fine
ActiveSheet.Cells(xRow , 6) = vBreakDate(0) 'DAY ?????
Next xRow
End Sub
In My Computer I get on the ActiveSheet:
yyyy mm dd
2011 7 12
2011 7 13
2011 8 30
so FINE.
But I my users computers they get:
yyyy mm dd
2011 12 7
2011 13 7
2011 30 8
so they get the Day instead of the month
And I don't know why
We are actually using the same workbook prepared for my to check what's wrong
DO I have to check country's code, language and/or???
What am I missing?
Thanks!