JamesW
Well-known Member
- Joined
- Oct 30, 2009
- Messages
- 1,197
Hi guys,
I have a spreadsheet which is populated by an SAP report. I made a macro to make changes to the sheet and make it look pretty etc.
All works well, apart from the dates seem to switch to US format randomly:
07.02.2011 changes to 02/07/2011
01.05.2011 changes to 05/01/2011
15.08.2011 stays the same (but with /'s)
Here's the problematic bit of my code:
Why doesn't that do what it's supposed to?! Removing .NumberFormat makes no difference aswell.
The original dates are stored as Text when they are pulled from SAP (Not sure if this would change anything).
I have a spreadsheet which is populated by an SAP report. I made a macro to make changes to the sheet and make it look pretty etc.
All works well, apart from the dates seem to switch to US format randomly:
07.02.2011 changes to 02/07/2011
01.05.2011 changes to 05/01/2011
15.08.2011 stays the same (but with /'s)
Here's the problematic bit of my code:
Code:
With Range("F:F")
.Replace What:=".", Replacement:="/"
.NumberFormat = "dd/mm/yyyy"
End With
The original dates are stored as Text when they are pulled from SAP (Not sure if this would change anything).