#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Day of Week and Date

I can give you a VB solution that will format the cell with the display
value you want and still keep the cell value as the date you enter. However,
you will have to identify, in advance, the cell or range of cells you want
it to apply to. For example, assuming you want this display functionality to
apply to the range A1:C9 (you can change this address range inside the code
as needed), then do the following...

Right click the tab at the bottom of the worksheet where the cells A1:C9 are
located, select View Code from the popup menu that appears and Copy/Paste
the following into the code windows that opened up...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("A1:C9")) Is Nothing _
And IsDate(Target.Value) Then
Target.NumberFormat = "dddd mmm. d""" & _
Mid$("thstndrdthththththth", 1 - _
2 * ((Day(Target.Value)) Mod 10) * _
(Abs((Day(Target.Value)) Mod 100 - 12) 1), _
2) & """"
Else
Target.NumberFormat = "General"
End If
End Sub

Now, go back to the worksheet and type in a date in one of the cells in the
specified range... it should display as you wanted.

--
Rick (MVP - Excel)


"Té" wrote in message
...
Is there a shortcut where it puts in the day and date? like ctrl ; does
the
date, but is there an easy way where I can get the day of the week and the
month in one cell?

"Rick Rothstein" wrote:

Whoops, I forgot the period after the abbreviated month name (also, I see
the newsreader broke the formula at an awkward location...fixed in this
formula)...

=TEXT(A1, "dddd, mmm. d")&MID("thstndrdth",
MIN(9,2*DAY(A1)*(MOD(A1-11,100)2)+1),2)

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message
...
Assuming A1 contains a real date, this formula will give you the output
you want...

=TEXT(A1, "dddd, mmm
d")&MID("thstndrdth",MIN(9,2*DAY(A1)*(MOD(A1-11,100)2)+1),2)

--
Rick (MVP - Excel)


"Té" wrote in message
...
Is there a way I can have the day of the week and the date, for
example
Tuesday Oct. 6th.




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 regular Date to Week Ending or Week Beginning Dates Sam H Excel Discussion (Misc queries) 5 April 3rd 23 04:39 PM
Display "this week" column headers w/date & day of week? Ivan Wiegand Excel Worksheet Functions 9 September 12th 07 05:18 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Finding the Monday date based on a different date in same week dandiehl Excel Worksheet Functions 4 April 11th 06 06:03 PM
I need week number in excell from a date, first week must be mini. jPeich Excel Discussion (Misc queries) 4 January 5th 05 01:21 AM


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