#1   Report Post  
Posted to microsoft.public.excel.misc
ir26121973
 
Posts: n/a
Default Date fields

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
  #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

  #3   Report Post  
Posted to microsoft.public.excel.misc
ir26121973
 
Posts: n/a
Default Date fields

Hi,

Thanks for getting back to me. I'll give it a try.

Regards

Chris

"Toppers" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculated Field in Pivot Table Based on Two Counted Fields cmlits Excel Discussion (Misc queries) 1 March 30th 06 05:44 AM
NETWORKDAYS - Multiple Date Selection Annabelle Excel Discussion (Misc queries) 3 October 4th 05 07:04 PM
How do I calculate if a date is in a certain time frame? Pe66les Excel Worksheet Functions 19 August 27th 05 11:07 PM
Count the occurances of a month in a range of date fields Keith Brown Excel Worksheet Functions 8 March 14th 05 11:24 AM
Sum function on multiple date fields rbrooks Excel Worksheet Functions 1 October 28th 04 09:56 PM


All times are GMT +1. The time now is 07:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"