Hi,
I have a much more complicated code but my issue can be broken down to this simple line.
Cell A1 starts off as, for example, "action 04/08/2017" (4th of August 2017, as I'm in the UK). My code removes the action part. Seems simple enough. The cell should read 04/08/2017 but Excel will flip it to 08/04/2017.
I understand that it's changing the date format to be US, or thinking it is in US and changing it to UK, but I can't for the life of me understand why or figure out how to stop it. If I type 04/08/2017 into a cell it shows up correctly, if I through any means cause code to type 04/08/2017 into a cell it'll change around to 08/04/2017. It's very frustrating.
Any help appreciated. Cheers.
Edit - just to simplify even further. If I run Range("a2").Value = "04/08/2017", I get 08/04/2017 in the cell.
This almost caused a huge disaster at work
I have a much more complicated code but my issue can be broken down to this simple line.
Code:
Range("a1").Value = Replace(Range("a1").Value, "action ", "")
Cell A1 starts off as, for example, "action 04/08/2017" (4th of August 2017, as I'm in the UK). My code removes the action part. Seems simple enough. The cell should read 04/08/2017 but Excel will flip it to 08/04/2017.
I understand that it's changing the date format to be US, or thinking it is in US and changing it to UK, but I can't for the life of me understand why or figure out how to stop it. If I type 04/08/2017 into a cell it shows up correctly, if I through any means cause code to type 04/08/2017 into a cell it'll change around to 08/04/2017. It's very frustrating.
Any help appreciated. Cheers.
Edit - just to simplify even further. If I run Range("a2").Value = "04/08/2017", I get 08/04/2017 in the cell.
This almost caused a huge disaster at work
Last edited: