Quote:
Originally Posted by grego9
I have a problem in Excel 2000. I have written some VBA code that transfers data from the current excel workbook to a file called "Deal Input2.xls". Everything transfers ok apart from the date in cell ("G28"). This gets converted into an American date in Deal input 2.xls. So even though the date in the current workbook is entered as 02/05/2008 the info gets transferred to deal input2.xls as 05/02/2008. I've played around by trying to change the format of the cell in both files to text, different date formats etc - but it doesn't seem to make much difference. I've heard that a command called local:=true might be able to help me - but I have no idea where to add this! The current code is as follows: Any help would be greatly appreciated
Why dont you use a Date variable instead of a Range one, this might help a little bit, i.e:
instead of
define it as
This way, the date will be stored as a numeric value, and you'll forget about its format.
And then, when it's already in the new workbook, just change the cell's format:
- Range("G28").NumberFormat = "m/d;@"
And always try to manage dates with numeric values, only formating them when showing them.
HTH.