US - British Dates

H

Howard31

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.
 
M

Mike H

Try this

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

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top