Date Format ActiveX TextBox

AndrewKent

Well-known Member
Joined
Jul 26, 2006
Messages
889
Hi there,

I have a TextBox linked to a cell on a spreadsheet via VBA coding. The cell is formatted "dd/mm/yyyy" and when I load the value of this cell into the text box (which is 02/11/2010) with the following lines:

Code:
        JML_Dashboard.txtJML_StartDate.Value = Worksheets("Employee Data").Range("M" & lngActiveRow & "").Value
        JML_Dashboard.txtJML_StartDate.Value = Format(JML_Dashboard.txtJML_StartDate.Value, "dd/mm/yyyy")

It ALWAYS shows the date as 11/02/2010. What am I doing wrong?

Andy
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
SOLVED:

Code:
        JML_Dashboard.txtJML_StartDate.Value = Worksheets("Employee Data").Range("M" & lngActiveRow & "").Text
        JML_Dashboard.txtJML_StartDate.Value = Format(JML_Dashboard.txtJML_StartDate.Value, "dd/mm/yyyy")
 
Upvote 0

Forum statistics

Threads
1,224,584
Messages
6,179,687
Members
452,938
Latest member
babeneker

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