visual basic user form date format dd/mm/yy not mm/dd/yy

G

Guest

I have set up a userform and dialog in visual basic, when the user enters the
date in dd/mm/yy format on the userform the actual data is stored on the
excel sheet as mm/dd/yy format. Can anyone suggest how to stop this please

Many thanks
 
G

Guest

Sub darren()
Dim d As Date
d = Now()
Range("A1").Value = d
Range("A1").NumberFormat = "dd/mm/yy"
End Sub


is an example of putting a date on the worksheet and specifying its format
at the same time.
 

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