Thread: Date Formatting
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Date Formatting

One way

Private Sub Worksheet_Change(ByVal Target As Range)
Const WS_RANGE As String = "H1:H10"

On Error GoTo ws_exit:
Application.EnableEvents = False
If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then
With Target
If IsDate(.Value) Then
If .NumberFormat = "dddd dd mmmm yyyy" Then
.Value = Format(.Value, "dddd " & vbLf & "dd mmmm yyyy")
End If
End If
End With
End If

ws_exit:
Application.EnableEvents = True
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.




--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Max" wrote in message
...
You're welcome !

As mentioned in the response,
do hang around awhile for views from others.

There just might be a way to do it directly (perhaps via vba ?)
that others may step-in to offer you.
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Big Rick" wrote in message
...
Many thanks.
This is a lot further than I would of got.
I would still like a solution if possible for the way described, as I

would
like to use it in other items, but your formula does work on this

occasion.

I am forever grateful and in your debt.
--
Big Rick