Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2006

Tip: Looking for answers? Try searching our database.

Changing the Date format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
reena - 27 Jan 2006 12:16 GMT
I want to write a macro by which I can change the date format fo
dd/mm/yyyy to mm/dd/yyyy.

How to do this
Bob Phillips - 27 Jan 2006 12:54 GMT
Why use a macro, why not just set the cell format to that?

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

> I want to write a macro by which I can change the date format fom
> dd/mm/yyyy to mm/dd/yyyy.
[quoted text clipped - 6 lines]
> reena's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=30440
> View this thread: http://www.excelforum.com/showthread.php?threadid=505689
Tom Ogilvy - 27 Jan 2006 15:19 GMT
but if you do want to set the format of a cell to mm/dd/yyyy with code, you
would use the numberformat property of the cell

Activecell.Numberformat="mm/dd/yyyy"

This will work if the underlying value in the cell is a date serial number.
If it is a text string, then no amount of formatting will change it.  You
will need to parse out the components and rearrange them.   Post back if
that is what you want.

Signature

Regards,
Tom Ogilvy

> I want to write a macro by which I can change the date format fom
> dd/mm/yyyy to mm/dd/yyyy.
>
> How to do this?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.