date format problem using Macro

M

mohavv

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
 
S

Sheeloo

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top