Macro to convert mmddyyyy format into mm/dd/yyyy format

  • Thread starter Thread starter maijiuli
  • Start date Start date
M

maijiuli

Hello,

I'm trying to write a macro to do this function:

=DATE(RIGHT(e2,4),LEFT(e2,LEN(e2)-6),LEFT(RIGHT(e2,6),2))

I attempted to record the macro and then used an existing loop function off
another part of code to loop through all dates in column E but is not working
too well.

Thank you very much,
 
Have you tried using the Format command in a macro script? It would look
something like,

dMyDate=Format(dExistingDate, "mm/dd/yyyy").

Note that the dd will always return a two digit date. Single digit dates
will be preceeded by a "0".

Hope that helps.
Mike
 

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

Back
Top