PC Review


Reply
Thread Tools Rate Thread

date format conversion

 
 
ezil
Guest
Posts: n/a
 
      26th Dec 2007
I have date data entered in a cell as general format like 24/12/07 (in
general format left side aligned)

I have to change this date to date format. How to change this through macro?

 
Reply With Quote
 
 
 
 
Kevin B
Guest
Posts: n/a
 
      26th Dec 2007
You could convert the date by inserting a helper column to the right of the
date column and enter the following formula (assuming the first date is in
cell A1):

=DATE(RIGHT(A1,2)+2000,MID(A1,4,2),LEFT(A1,2))

Copy down the column as far as necessary, copy the entire contents of the
formula column and then do a EDIT/PASTE SPECIAL and paste the formula results
over the original date column.

Delete the heplper column when done.
--
Kevin Backmann


"ezil" wrote:

> I have date data entered in a cell as general format like 24/12/07 (in
> general format left side aligned)
>
> I have to change this date to date format. How to change this through macro?
>

 
Reply With Quote
 
ward376
Guest
Posts: n/a
 
      26th Dec 2007
Assuming the data is in a1 and you're converting into b1:

With Range("b1")
.FormulaR1C1 = _
"=VALUE(CONCATENATE(MID(RC[-1],4,2),""/"",LEFT(RC[-1],
2),""/"",RIGHT(RC[-1],1)))"
.NumberFormat = "mm/dd/yy;@"
End With

Cliff Edwards
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
permanent conversion of 1904 date format to 1900 date format Jos Microsoft Excel Worksheet Functions 3 21st Jul 2009 06:32 PM
Conversion of date into different format Fam via OfficeKB.com Microsoft Excel Misc 8 31st Jul 2006 09:14 PM
Date Format Conversion =?Utf-8?B?UGFwdXR4aQ==?= Microsoft Access Queries 3 7th Jun 2006 02:04 AM
date format conversion =?Utf-8?B?bGlueiBmaXNrZQ==?= Microsoft Access 5 19th Aug 2005 04:26 AM
Date Format Conversion Mario Microsoft Access Queries 7 8th Jul 2004 02:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:20 AM.