+ Reply to Thread
Results 1 to 9 of 9

date formatting in userform

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    date formatting in userform

    i have a number of textboxes where i input dates or not but i would like dates to be DD/MM/YY not MM/DD/YY i dont fill all boxes so sometimes have blanks and when i fill in boxes a may delete date if that person no longer have
    any help would be good

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: date formatting in userform

    Try converting the 'text' dates into 'real' dates using CDate or DateValue.

    For example if TextBox9 contained a date.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: date formatting in userform

    sorry i cant get it working if i use Cdate it works if i fill in the box but if that box is blank it showa error, its showing it right on the userform but not in excel sheet i have formatted the excel sheet to uk DD/MM/YY
    this is what i have done to the code it really doing my head in i did try and upload file but did not work

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: date formatting in userform

    i managed to download file if anybody can have a look at this if you need to login to my system the username is username and password is password
    thanks
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: date formatting in userform

    all codes i am using is from bits off the web so if you can see a better way that would be good thanks

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: date formatting in userform


  7. #7
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: date formatting in userform

    can anyone help please? I have inserted an exemple above.
    Thanks

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: date formatting in userform

    I responded in the OzGrid thread.

  9. #9
    Registered User
    Join Date
    01-12-2012
    Location
    Staffordshire
    MS-Off Ver
    Excel 2010
    Posts
    38

    Re: date formatting in userform

    thanks Norie that solution did not work

    i would like to thank everyone that helped i have found the solution all i needed to do was change "DD/MM/YY") to "DD/MMM/YYYY") and it works perfect,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formatting a date from userform, then filtering.
    By Ash_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 01:15 PM
  2. Date picker UserForm to stay always in front of the main UserForm
    By Gabor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-11-2014, 07:31 AM
  3. [SOLVED] Excel 2007, Userform Textbox Date Format and Calendar Control Userform
    By riffology in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-03-2014, 06:18 PM
  4. [SOLVED] Userform TextBox Problem... formatting code clears data instead of formatting
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-26-2012, 11:00 AM
  5. Userform Date Formatting MM/DD/YYYY
    By Mike in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2010, 12:51 AM

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