User Form Text Box Problems

Juan Cornetto

New Member
Joined
Mar 5, 2013
Messages
44
I know there are millions of similar questions and solutions to changing the date form in a text box but all the ones I have found is for user inputs into the text box on the form. I have a user form which is populated from cells in a selected row with the following code

With Me


.DateTextBox.Value = Cells(ActiveCell.Row, "A").Value
.DateTextBox.Text = Format("dd/mm/yy")
.TimeTextBox.Value = Cells(ActiveCell.Row, "C").Value
.TextBox1.Value = Cells(ActiveCell.Row, "D").Value
.DescriptionTextBox.Value = Cells(ActiveCell.Row, "F").Value
.DoTextBox.Value = Cells(ActiveCell.Row, "G").Value
.ReportTextBox.Value = Cells(ActiveCell.Row, "H").Value


End With

It all works except the date in the text box appears in mm/dd/yy format instead of dd/mm/yy.

Any help would be appreciated
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Hi,

Try this for the date


.DateTextBox.Value = Format(Cells(ActiveCell.Row, "A").Value, "DD/MM/YYYY")
 
Upvote 0
Or you could take the format from the worksheet.

Code:
With Me
    .DateTextBox.Text = Cells(ActiveCell.Row, "A").Text

    .TimeTextBox.Text = Cells(ActiveCell.Row, "C").Text
    .TextBox1.Text = Cells(ActiveCell.Row, "D").Text
    .DescriptionTextBox.Text = Cells(ActiveCell.Row, "F").Text
    .DoTextBox.Text = Cells(ActiveCell.Row, "G").Text
    .ReportTextBox.Text = Cells(ActiveCell.Row, "H").Text
  
End With
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,629
Messages
6,120,630
Members
448,973
Latest member
ChristineC

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