Hi all,
First message on that forum, so glad to join the community.
I have an issue with date formats.
I have a CSV file with dates in the US format: MM/DD/YYYY
I am French, we are using the date format DD/MM/YYYY (called here: non-US format).
My question is NOT about converting one into the other. I can do it, it is not very difficult. I have a different issue.
I made a vba program that copy-paste those dates from one sheet to another to later process them to do whatever I need to do.
The problem I have is that sometimes excel understands it is originally a US format and automtically converts it into non-US when pasting. But sometimes it does not understand it and does not convert it...
The weirdest thing about it is that the same file, wih the same dates and processed in the same way may give different results, sometimes excel understands, sometimes it doesn't.... It seems to happen randomly.
Because of it, there is nothing I can reliably do to automate the format change. Any code I write might work if dates remained in US format when pasting, but will fail if it had been converted, and vice versa.
What I would like is to either:
-inform excel that those dates are US format in the first place instead of letting it decide. (I don't even know if it is possible)
-disable auto-convert when pasting.
- or, be able to know what format Excel believes it is, so I can automatically decide whether I trigger my conversion program or not.
Can someone help me with this?
Thanks.
First message on that forum, so glad to join the community.
I have an issue with date formats.
I have a CSV file with dates in the US format: MM/DD/YYYY
I am French, we are using the date format DD/MM/YYYY (called here: non-US format).
My question is NOT about converting one into the other. I can do it, it is not very difficult. I have a different issue.
I made a vba program that copy-paste those dates from one sheet to another to later process them to do whatever I need to do.
The problem I have is that sometimes excel understands it is originally a US format and automtically converts it into non-US when pasting. But sometimes it does not understand it and does not convert it...
The weirdest thing about it is that the same file, wih the same dates and processed in the same way may give different results, sometimes excel understands, sometimes it doesn't.... It seems to happen randomly.
Because of it, there is nothing I can reliably do to automate the format change. Any code I write might work if dates remained in US format when pasting, but will fail if it had been converted, and vice versa.
What I would like is to either:
-inform excel that those dates are US format in the first place instead of letting it decide. (I don't even know if it is possible)
-disable auto-convert when pasting.
- or, be able to know what format Excel believes it is, so I can automatically decide whether I trigger my conversion program or not.
Can someone help me with this?
Thanks.