Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
RTANSW via OfficeKB.com
 
Posts: n/a
Default Date Formats Available

Hi,

I was wondering if there was a date format that anyone was aware of that
would make the date appear as such:

Entered in as 30/12/1979
Displayed as 30th December, 1979

Thanks in Advance,

RTANSW

--
Message posted via http://www.officekb.com
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

You'd need a VBA event macro to do this.

If you can live with

30 December, 1979

then

Format/Cells/Number/Custom dd mmmm, yyyy

will do.

In article ,
"RTANSW via OfficeKB.com" wrote:

I was wondering if there was a date format that anyone was aware of that
would make the date appear as such:

Entered in as 30/12/1979
Displayed as 30th December, 1979

  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 31 May 2005 23:01:52 GMT, "RTANSW via OfficeKB.com"
wrote:

Hi,

I was wondering if there was a date format that anyone was aware of that
would make the date appear as such:

Entered in as 30/12/1979
Displayed as 30th December, 1979

Thanks in Advance,

RTANSW


There is no specific format; you would have to change the format each time you
entered a date, to use the appropriate ordinal number.

You could use an event triggered macro. Let us say, for example, that your
date is in A1.

Right click the worksheet tab; select View Code, and paste the code below into
the window that opens.

Then enter a date, or a formula returning a date, into A1.

This could be made more efficient, depending on the details of your data entry.

=================================
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Suffix As String
Dim Dt As Range

Set Dt = Range("A1")

If Not IsNumeric(Dt) And Not IsDate(Dt) Then Exit Sub
'Dates returned from functions, like TODAY(), will fail IsDate

Select Case Day(Dt)
Case Is = 1, 21, 31
Suffix = "st"
Case Is = 2, 22
Suffix = "nd"
Case Is = 3, 23
Suffix = "rd"
Case Else
Suffix = "th"
End Select

Dt.NumberFormat = "d""" & Suffix & """ mmmm, yyyy"

End Sub
================================


--ron
  #4   Report Post  
RTANSW via OfficeKB.com
 
Posts: n/a
Default

Thankyou very much!

--
Message posted via http://www.officekb.com
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
Reading Date Formats e.g 20050801 (yyyy/mm/dd) Nathan Excel Discussion (Misc queries) 4 May 25th 05 10:06 AM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM
excel date formats changed bob Excel Worksheet Functions 1 March 1st 05 02:59 PM
Seed date formats to different year in different cells KR Excel Discussion (Misc queries) 4 February 12th 05 12:02 AM
troubleshooting date formats 12pt93 Excel Discussion (Misc queries) 3 January 6th 05 04:14 PM


All times are GMT +1. The time now is 01:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"