Date changes from "dd/mm/yyyy" to "mm/dd/yyyy" from userform to worksheet

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
I'm having problems with a userform I fill in to add data to a worksheet and also to view data on the worksheet.

This is one of the lines of code I am using to put the code to the worksheet that is causing me problems (I have several fields with dates).

VBA Code:
Activecell.Offset(,1).Value = Me.textStartDate.Value

I thought i'd be able to put Format at the start of the code with "dd/mm/yyyy" at the relevant place but that didn't work so i'm out of ideas.

Any help is always appreciated
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,
try coercing your textbox text to date

VBA Code:
ActiveCell.Offset(, 1).Value = DateValue(Me.textStartDate.Value)

Dave
 
Upvote 0

Forum statistics

Threads
1,214,846
Messages
6,121,905
Members
449,054
Latest member
luca142

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