View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
GavinS GavinS is offline
external usenet poster
 
Posts: 18
Default Formatting date as first letter of day only

Thanks for all your responses. Regretfully the solution is way too
complicated. TO explain.

I have a time sheet - user enters in the first day of the month.
Another cell points to this first day and interprets this date as a
day - which I can just format as ddd - but it takes up too much space.
To teh right of this cell is the remaining days of the month -
formatted as ddd.

So Wouter's suggestion is the best but not dynamic enough - because
the 1st of every month never falls on the same day.



On Dec 17, 5:20*am, Wouter HM wrote:
Hi Gavin,

You can create your own User Defined Function.
Eg:

Public Function FirstOfWeekday(aDate As Date) As String

* * Dim iWeekday As Integer

* * iWeekday = Weekday(aDate, vbSunday)

* * FirstOfWeekday = Choose(iWeekday, "S", "M", "T", "W", "T", "F",
"S")

End Function

On your sheet you enter the formula =FirstOfWeekday(Now()).

HTH,

Wouter