#1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 21
Default Date Format

I have copied and pasted a word table into excel which was a pain in
itself. The date format in word was Thu 21st June 2007. But the
table would not sort into date order so I had to remove the "Thu"
part. I then had to remove the paragraph sign as it was throwing
extra cells in excel when I pasted it. Eventually the date went into
excel but now I cannot format the date.

When I look at the format 21st June 2007 it has defaulted to General
under "format cell". When I change the format to say custome date it
does not make a difference, the only way it shacges is if I manually
type the date in. Is there a quicker way?

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 11,058
Default Date Format

Say you have a column of text values that should be dates, for example A1:

Thu 21st June 2007

First enter the following UDF:

Function date_it(r As Range) As Date
Dim v As String
v = r.Value
s = Split(v, " ")
n = Len(s(1)) - 2
v = Left(s(1), n) & " " & s(2) & " " & s(3)
date_it = DateValue(v)
End Function

Next format another cell as Date and enter:
=date_it(A1) to display:
6/21/2007

This will be a "real" date.

--
Gary''s Student - gsnu2007


" wrote:

I have copied and pasted a word table into excel which was a pain in
itself. The date format in word was Thu 21st June 2007. But the
table would not sort into date order so I had to remove the "Thu"
part. I then had to remove the paragraph sign as it was throwing
extra cells in excel when I pasted it. Eventually the date went into
excel but now I cannot format the date.

When I look at the format 21st June 2007 it has defaulted to General
under "format cell". When I change the format to say custome date it
does not make a difference, the only way it shacges is if I manually
type the date in. Is there a quicker way?


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
Convert European Date format to American Format Albert Excel Discussion (Misc queries) 3 August 21st 07 10:02 PM
Convert date from text format to date format Anita Excel Discussion (Misc queries) 3 June 4th 07 11:57 AM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
Can I change a date with no format (20051111) to date format? Rose New Users to Excel 2 November 11th 05 09:03 PM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM


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