Date changing format when shown in a userform

Diving_Dan

Board Regular
Joined
Oct 20, 2019
Messages
161
Hi all,

I know I've had this problem before I can't remember for the life of me how to fix it.

I have a userform that displays data from a worksheet. It is one line of code that is causing me problems
VBA Code:
Me.txtTsCsAcceptedOn.Value = ActiveCell.Offset(, 8).Value
The date is stored in the worksheet in the format of dd/mmm/yyyy but when it is shown on the userform is shows as mm/dd/yyyy when I would like it to remain in the same format as the worksheet.

Any help will be greatly appreciated as always.

Dan
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Try:
VBA Code:
Me.txtTsCsAcceptedOn.Value = CDate(ActiveCell.Offset(, 8).Value)
 
Upvote 0
Try using the Range.Text property which should return what you see in the cell rather than its underlying value

Rich (BB code):
Me.txtTsCsAcceptedOn.Value = ActiveCell.Offset(, 8).Text

Dave
 
Upvote 0
Solution

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

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