Originally Posted by
laxminarayana
Hello,
In cell B5 of sheet1 contains a date which changes everytime when i open excel file. The date is in the M/D/YYYY format.
I am using the following code to use that date in MM/DD/YYYY format.
If cell B5 of sheet1 is 2/1/2014, but my code is resulting in wrong as 01/02/2014.
How to fix this?
The numberformat "M/D/YYYY" is a special format that will give the default date format corresponding to the date format defined by the ControlPanel in Windows. Which in your country is "DD/MM/YYYY"
So that is the format you should use in your code:
If you want your Workbook to be exported in other countries like USA, better is to use
as suggested by Norie.
Cheers
Docmarti
Bookmarks