View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default US - British Dates

Try this

mypart = Split(Textdate.Text, "/")
Range("a1").Value = _
DateSerial(mypart(2), mypart(1), mypart(0))

Mike

"Howard31" wrote:

I have a Userform where the user enters a date in british format (dd/mm/yyyy)
and the date is then copied to excel. My problem is that excel interperts it
as US dates for example if the user enters 09/12/2008 the vba copies it to
excel as 12/09/2008. I've tried Cstr before i.e Range("A1").Value =
Cstr(TextDate.Value) and also the Format function as in Range("A1").Value =
Format(TextDate.Value,"dd/mm/yyyy"), but non of this seems to do the trick.

--
A. Ch. Eirinberg