Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Changing the Date format


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

--
reen
-----------------------------------------------------------------------
reena's Profile: http://www.excelforum.com/member.php...fo&userid=3044
View this thread: http://www.excelforum.com/showthread.php?threadid=50568

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Changing the Date format

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)

"reena" wrote in
message ...

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?


--
reena
------------------------------------------------------------------------
reena's Profile:

http://www.excelforum.com/member.php...o&userid=30440
View this thread: http://www.excelforum.com/showthread...hreadid=505689



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Changing the Date format

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.

--
Regards,
Tom Ogilvy

"reena" wrote in
message ...

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?


--
reena
------------------------------------------------------------------------
reena's Profile:

http://www.excelforum.com/member.php...o&userid=30440
View this thread: http://www.excelforum.com/showthread...hreadid=505689



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
Changing the date format on the date table in a chart spudsnruf Charts and Charting in Excel 2 September 3rd 09 07:08 PM
Changing the Format of a Date Liz J[_2_] Excel Discussion (Misc queries) 6 November 27th 08 08:03 PM
Changing Date Format mrbalaje Excel Discussion (Misc queries) 1 August 22nd 07 11:43 AM
Changing Date Format Chris Excel Discussion (Misc queries) 3 January 25th 07 04:47 PM
Changing Date Format stittal Excel Worksheet Functions 5 October 24th 05 07:49 PM


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