Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: Date Format Problem in Userform

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    Surrey, United Kingdom
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default


    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

  3. #3
    Board Regular
    Join Date
    Apr 2002
    Location
    Surrey, United Kingdom
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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 ]

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    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

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •