NessPJ
Active Member
- Joined
- May 10, 2011
- Messages
- 420
- Office Version
- 365
Hello,
In my VBA routine i have 2 lines of code that i user every now and then to put (log) the current date/time somewhere.
When the Day of the month can be interpreted as a Month, Excel suddenly seems to turn these 2 around in the value that is being show (very annoying).
For example, when i run this today, the output will be: 11-06-20 09:20
As soon as the 13th day of the month is reached. This is no longer a problem and the same code will suddenly show: 13-11-20 09:20
What can i do to solve this? I hope its not a System Region thing...because i would like to solve it within the VBA.
In my VBA routine i have 2 lines of code that i user every now and then to put (log) the current date/time somewhere.
VBA Code:
Sheets("Masterdata").Range(Foundvalue).Offset(0, 4).NumberFormat = "DD-MM-YY hh:mm"
Sheets("Masterdata").Range(Foundvalue).Offset(0, 4).Value = Format(Now, "dd-mm-yy hh:mm")
When the Day of the month can be interpreted as a Month, Excel suddenly seems to turn these 2 around in the value that is being show (very annoying).
For example, when i run this today, the output will be: 11-06-20 09:20
As soon as the 13th day of the month is reached. This is no longer a problem and the same code will suddenly show: 13-11-20 09:20
What can i do to solve this? I hope its not a System Region thing...because i would like to solve it within the VBA.