Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default date format problem using Macro

Hi,

I import files with dates like this: 12.02.2007 (dd.mm.yyyy)

When I run a find and replace it changes to 12/02/2007. This is ok.

BUT when I record this exact find and replace in a Macro then suddenly
it changes it to: 02/12/2007 but still as dd/mm/yyyy

How is this possible, and how to solve this.

Cheers,

Harold
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default date format problem using Macro

My default date format is mm/dd/yyyy so when I pasted 12.02.2007 in a cell
and replaced . with / I got
12/02/2007 which is 2-Dec-2007...

What do you mean when you say you get 12/02/2007 through a macro? If you
pass it as an string to the macro you will get it back as a string... when
you paste the string in a cell with date format Excel will interpret it and
show it accordingly (which should be same as manual search and replace)...

If this does not solve your problem then pl. paste the macro and paste the
date after formatting it as "mmm-dd-yyyy"
--
If you find this post helpful pl. choose "Yes"...


"mohavv" wrote:

Hi,

I import files with dates like this: 12.02.2007 (dd.mm.yyyy)

When I run a find and replace it changes to 12/02/2007. This is ok.

BUT when I record this exact find and replace in a Macro then suddenly
it changes it to: 02/12/2007 but still as dd/mm/yyyy

How is this possible, and how to solve this.

Cheers,

Harold

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
date format problem?? Steve[_9_] Excel Discussion (Misc queries) 10 December 27th 07 11:23 PM
Date Format Problem Gayla Excel Discussion (Misc queries) 3 April 18th 07 07:48 PM
Date format problem Vass Excel Worksheet Functions 7 April 3rd 06 04:50 PM
Date Format problem nastech Excel Discussion (Misc queries) 2 January 18th 06 01:54 AM
date format problem Nigel Excel Discussion (Misc queries) 7 May 11th 05 12:57 PM


All times are GMT +1. The time now is 11:15 PM.

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

About Us

"It's about Microsoft Excel"