Date Format Problem in Userform

Nibbles

Board Regular
Joined
Apr 1, 2002
Messages
75
Afternoon everyone,

I have a column of dates on a spreadsheet formatted as dd/mm/yy. These dates are linked to text boxes in a userform, however when viewed from the userform they appear as mm/dd/yy! This will make it very confusing for a user. Does anyone know how to get the dates to appear as dd/mm/yy on the userform?

Many thanks,

Nibbs
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
You could have a default date come up in the textbox when the userform opens so that the user knows which format to use.

In the userform initialize event put this:

Textbox1.Value = Format(Date, "dd/mm/yy")

That'll put today's date in when they open it up, so they can change it accordingly

Audiojoe
 
Upvote 0
Thanks AudioJoe,

I think a little more explanation is needed on my part. A user is prompted to enter dates and other details via a seperate userform which inputs these details to a worksheet. The user is prompted to enter the date as dd/mm/yy via the text box label.

However, if a user notices a mistake with an entry, I have a seperate userform where they can edit an exisitng entry. They select the entry via a reference number and it will then show all the details for that row in seperate text boxes - one of the fields being the date. It is here where it appears as mm/dd/yy. So they enter it as one thing, then if they go back t edit it, it will be displayed to them as something else! Even though in the worksheet it remans as dd/mm/yy.

So what I need is some way of specifying what date format a text box uses, as it obviously assumes a mm/dd/yy default format, and not the format from its source.

Hope this explains more,

Nibbs
This message was edited by Nibbles on 2002-04-30 08:20
This message was edited by Nibbles on 2002-04-30 08:22
 
Upvote 0
Audio Joe was correct...
When you populate your text boxes, force the format...

For example:

Text1.Text = Format(Cells(1,1),"dd/mm/yy")

Tom
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,176
Members
448,554
Latest member
Gleisner2

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