paste date from text box in form to cell

ohexcell_ineedu

New Member
Joined
Jan 28, 2012
Messages
47
Hey guys,

i am having some trouble pasting dates in the format dd/mm/yyyy to a cell. I have seen some solutions on the web but i was hoping for a quick fix solution, i can't believe that it should be a difficult task.

I have a form. I enter dates in the form in the format dd/mm/yyyy. Then when i paste the contents from the form to the cell it changes the format to mm/dd/yyyy.

Would someone please help me with this one. Are there some settings that i can change to stop this from happening.

You can download a xlsm file that does exactly as i describe from here https://dl.dropboxusercontent.com/u/9154762/Book1.xlsm

Thanks for any and all help.
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hey guys,

i am having some trouble pasting dates in the format dd/mm/yyyy to a cell. I have seen some solutions on the web but i was hoping for a quick fix solution, i can't believe that it should be a difficult task.

I have a form. I enter dates in the form in the format dd/mm/yyyy. Then when i paste the contents from the form to the cell it changes the format to mm/dd/yyyy.

Would someone please help me with this one. Are there some settings that i can change to stop this from happening.

You can download a xlsm file that does exactly as i describe from here https://dl.dropboxusercontent.com/u/9154762/Book1.xlsm

Thanks for any and all help.

Is your regional settings set to NA? DD/MM/YYYY is the EU "version of dates". You can change this in the windows regional settings. Else, just format the cells with custom formatting, should stick.
 
Upvote 0
Is your regional settings set to NA? DD/MM/YYYY is the EU "version of dates". You can change this in the windows regional settings. Else, just format the cells with custom formatting, should stick.

Hey Arithos, my regional settings are set to australia, which makes the system date dd.mm.yyyy. And custom formatting doesn't work, because it is literally switching the dd and mm values around unfortunately.
 
Upvote 0
Or split the date:

Code:
Dim myDate As Variant
myDate = Split(Me.TextBox1.Value,"/") ' or "." if you use dots.
Range("A1").Value = DateSerial(myDate(2),myDate(1),myDate(0))

Yes into the commandbutton click code
 
Upvote 0

Forum statistics

Threads
1,206,833
Messages
6,075,130
Members
446,123
Latest member
junkyardforme

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