+ Reply to Thread
Results 1 to 9 of 9

UserForm Date input as UK

  1. #1
    Registered User
    Join Date
    11-23-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    UserForm Date input as UK

    I’m sure this has been asked a thousand times.

    I have spent a couple of hours looking for the answer I need to no avail.

    Can someone please tell me how I get the userform I have created to input the date in Uk format, and then recognise that it is a date once passed to the spreadsheet. Currently it will only work as intended if input as a US date.

    Workbook attached.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,105

    Re: UserForm Date input as UK

    Date validation isn't simple, IMO. It could be that all you need is:
    Please Login or Register  to view this content.
    However, if an American style date is input, it will be converted, so 3/14/15 will become 14/03/2015.

    So, you might want to split the values and build a date before you convert it.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: UserForm Date input as UK

    I had to rebuild your userform to make this work.

    Try the attached file.
    Attached Files Attached Files
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

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

    Re: UserForm Date input as UK

    @ Trevor et al.,

    VBA is American centric. Since the CDate function is Internationally aware. Your solution should work since it will check the user's locale when doing the conversion.
    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!)

  5. #5
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: UserForm Date input as UK

    Why not just use a date picker?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,105

    Re: UserForm Date input as UK

    Thanks Leith

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

    Re: UserForm Date input as UK

    Hello Trevor,

    'S e do bheatha.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,105

    Re: UserForm Date input as UK

    Ah, spilt coffee on your keyboard

  9. #9
    Registered User
    Join Date
    11-23-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    21

    Re: UserForm Date input as UK

    Thanks for all the help guys.

    mehmetcik that is spot on.

+ 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. [SOLVED] Pass Value of combobox selected in Userform as input to textbox of other userform
    By Pradeepg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2013, 10:32 AM
  2. How to create a basic level userform with input as date and cell values as output
    By catchnanan in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-15-2013, 02:52 PM
  3. Replies: 4
    Last Post: 11-28-2012, 06:09 PM
  4. Insert date on userform based upon previous text box input.
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 02-02-2012, 04:09 PM
  5. Select sheet based on userform date input
    By mugitty in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-22-2006, 05:37 PM

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