imported date format

dialup

Board Regular
Joined
Jan 10, 2008
Messages
99
i have a workbook that imports data from a backup csv file.

i use the

Code:
sheets(sheetname).copy after = workbooks("my workbook.xls").sheets(2)
to copy the whole sheet into my workbook.
numerouse columns contain date and times in the format dd/mm/yyyy hh:mm in the csv file the date format after copying is still dd/mm/yyyy hh:mm but the date has changed i.e 12/03/2009 22:45 is now 03/12/2009 22:45 but the formatting means it is the 3rd of december.

even worse 13/03/09 22:45 in the origional csv file reads 13/03/09 22:45 after copying but the format shows as text not numeric. i can not get the backup file format changed, can anyone help me to stop the format changing - when i do it manually the date does not switch it is only when the macro is used that the dates switch.

I am using 2003
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
This is a known problem.
Need to convert the date back to the correct serial number using TimeValue()
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,428
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top