How do I stop excel switching to US dates?

Oliver Dewar

Board Regular
Joined
Apr 17, 2011
Messages
201
Hi All,

I'm stuck!

I need my dates to display as UK dates DD/MM/YYYY.

I have a textbox on a userform in which the user inputs a date DD/MM/YYYY.

I have formatted the cell that the date get's put into as DD/MM/YYYY.

The problem is that the days and months are being swapped around when the date hits the cell... so:

07/12/2000 (7th of Dec 2000)

becomes 12/07/2000 (12 th of July 2000)

How can I stop this from happening?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Excel can be a bit of a pain like that...........

I suggest forcing the date by always formatting it in the code, when you throw it over from the textbox:

Code:
......sheets("sheet2").range("A1").value = format(userform1.textbox1.value,"DD/MM/YYYY")
Not tested, but it should do the trick. Obviously you'll need to change the references etc, but it should give you the gist. Just post back if it doesn't do the trick - and include your code as well.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top