+ Reply to Thread
Results 1 to 5 of 5

Set default date format of all text boxes on a user form

  1. #1
    Forum Contributor
    Join Date
    05-14-2012
    Location
    England
    MS-Off Ver
    Excel 2010/2013
    Posts
    100

    Set default date format of all text boxes on a user form

    I've made a userform with lots of text boxes. is there a way to set the default date format on each box ideally from the VBA editor but by VBA if not. Bare in mind that I'd need some of the text boxes to remain as text not dates. Thank you.

  2. #2
    Registered User
    Join Date
    07-05-2012
    Location
    Swindon
    MS-Off Ver
    2007
    Posts
    10

    Exclamation Re: Set default date format of all text boxes on a user form

    I'm having the same problem. I have dates in my spreadsheet that are formatted dd/mm/yyyy but on the form they show up as mm/dd/yyyy, Please does someone have a fix/answer?
    Last edited by richiev4; 08-24-2012 at 11:27 AM. Reason: Spelling

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Set default date format of all text boxes on a user form

    Hello KAPearson,

    There is no method built in to the VBA editor to do what you asked. It will have to be done using VBA. If you post your workbook then I can write the code you need to do this easily. The process involves Subclassing the TextBox controls to automatically format the date. This is a little more complex approach but is much easier and faster that copying code into each TextBox.

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Set default date format of all text boxes on a user form

    Leith,

    I'd also be interested in seeing your approach. If KAPearson doesn't upload a file, could you possibly still show us the approach using a mock file?

    Thanks,
    Bas

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Set default date format of all text boxes on a user form

    Hello BigBas,

    Certainly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1