Thread: Date fields
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Toppers
 
Posts: n/a
Default Date fields

Chris,
Try adding this to your code - amend column as needed:

Range("A:A").NumberFormat = "dd/mm/yyyy hh:mm"

HTH

"ir26121973" wrote:

Hi,

Wonder if someone can help please.

I am currently using a macro that takes many hundred .csv files that are
email attachments and copies them into one master spreadsheet. Within this
spreadsheet that are text, numeric and date fields.

When I copy the information into the master spreadsheet the date fields
change from dd/mm/yyyy hh:mm to mm/dd/yyyy hh:mm.

Has anyone an idea how I can stop this happening please? I've tried
allsorts. I know I can change the format for the fields within the excel, but
I'm wanting if possible to put this in the coding because there is an awful
lot of data to sort through.

Thanks and regards

Chris