PC Review


Reply
Thread Tools Rate Thread

Change a date in text format xx.xx.20xx to a recognised date format

 
 
concatenator
Guest
Posts: n/a
 
      24th Nov 2003

I often have to deal with a column of text in the format of xx.xx.19xx.
However this is not a recognised date format.

Is there a macro or command that will allow me to select all of thes
cells and convert them into a recognised date format, eg xx/xx/19xx o
xx-jan-19xx?

At present i can split them out to columns and then concatenate th
data into a date format but this only works the cell in Row 1,not fo
the whole selection. Any suggestions? Cheer

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

 
Reply With Quote
 
 
 
 
Trevor Shuttleworth
Guest
Posts: n/a
 
      25th Nov 2003
I think the easiest way would be to select the column and do a global
replace of "." for "/".

You could record a macro as you do it ... should look something like this:

Columns("B:B").Select
Selection.Replace What:=".", Replacement:="/", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False

A slightly modified version:

Columns("B:B").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False

In my testing the text was turned into dates with a date format "dd/mm/yyyy"
(which is what I expected).

Be careful if you opt for a VBA solution as dates can become "muddled" by
the USA-centricity of VBA

Regards

Trevor


"concatenator" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I often have to deal with a column of text in the format of xx.xx.19xx.
> However this is not a recognised date format.
>
> Is there a macro or command that will allow me to select all of these
> cells and convert them into a recognised date format, eg xx/xx/19xx or
> xx-jan-19xx?
>
> At present i can split them out to columns and then concatenate the
> data into a date format but this only works the cell in Row 1,not for
> the whole selection. Any suggestions? Cheers
>
>
> ------------------------------------------------
> ~~ Message posted from http://www.ExcelTip.com/
> ~~View and post usenet messages directly from http://www.ExcelForum.com/
>



 
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
Convert date (m/dd/yyyy) in text format into an excel recognised date Rob P Microsoft Excel Programming 3 30th Apr 2010 12:40 AM
Different Date formats in text to be recognised as date value swiftcode Microsoft Excel Programming 8 16th Oct 2009 08:37 AM
Re: Excel:Get concatenated text to be recognised as formula not text? Chip Pearson Microsoft Excel Misc 1 15th Jan 2007 02:39 PM
how do i change 20050614 within in a cell to a recognised date =?Utf-8?B?UmljaGFyZCBjYXJwZW50ZXIgQCB1bmlx?= Microsoft Excel Worksheet Functions 1 8th Jun 2005 11:32 AM
Converting e.g. 28-07-2004 to recognised date format claytorm Microsoft Excel Misc 12 21st Aug 2004 03:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:43 AM.