Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Macro to convert mmddyyyy format into mm/dd/yyyy format

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,


--
Thank You!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Macro to convert mmddyyyy format into mm/dd/yyyy format

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

"maijiuli" wrote:

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,


--
Thank You!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Macro to convert mmddyyyy format into mm/dd/yyyy format

Why not just

Selection.NumberFormat = "mm/dd/yyyy"

Cliff Edwards

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
how do I convert date format yyyymmdd to mm/dd/yyyy Datahead Excel Worksheet Functions 3 May 11th 23 11:45 AM
How do I change date format m/d/yyyy to mmddyyyy toremove the dash CyndiR Excel Worksheet Functions 3 June 11th 09 08:52 PM
How do I convert a birthdate format from yyyy/mm/dd to mm/dd/yyyy Amy Ann Excel Worksheet Functions 3 December 13th 07 08:07 PM
Change m/d/yyyy to mmddyyyy in text Alicia Excel Discussion (Misc queries) 4 December 22nd 06 04:20 PM
How to convert the dates from the YY:DD forma to MM/dd/YYYY format Sam Excel Worksheet Functions 4 July 15th 05 12:01 PM


All times are GMT +1. The time now is 02:34 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"