+ Reply to Thread
Results 1 to 6 of 6

Date Format error in userform

  1. #1
    Registered User
    Join Date
    08-11-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    33

    Date Format error in userform

    Hi

    I know this is a common problem. but i have tried solutions and they haven't worked for me or I havent been able to use them effectively.

    My problem is that I have a userform which enters data into excel, it has the option to search and update the data.

    When it comes to either entering new data or loading previously entered data, my data comes in american format "mm/dd/yyyy" but I need it to be in uk format "dd/mm/yyyy".

    Please Login or Register  to view this content.

  2. #2
    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: Date Format error in userform

    Hello rayexcel,

    VBA is notoriously "American" and causes all sorts of problems when using it internationally. It looks like you have converted the TextBox input to the correct date format. You also need to make sure the cell format is set to the same date format. Did you format your date column?
    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!)

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

    Re: Date Format error in userform

    When reading from the worksheet try using Text instead of Value for any date values.

    When writing to the worksheet try using CDate or DateValue to convert the text date from the textbox to a 'real' date.
    If posting code please use code tags, see here.

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

    Re: Date Format error in userform

    HeyInKy

    You really should start your own thread.

  5. #5
    Registered User
    Join Date
    08-11-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    33

    Re: Date Format error in userform

    Hey Norie

    with the CDate/DateValue where and how would I place that

    So therefore in my find sub, I would use
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-11-2014
    Location
    london
    MS-Off Ver
    2007
    Posts
    33

    Re: Date Format error in userform

    Hey Leith

    Yes my date column is formatted in "short date" format

+ 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] UserForm Textbox Date Format (yyyy/mm/dd) Error Exl.2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-26-2014, 11:22 AM
  2. [SOLVED] Userform Date Format Error 6 Overflow
    By Prexcel in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-17-2014, 12:39 PM
  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 date entered in UK format but showing in US Format in spreadsheet
    By michelle 1 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-23-2013, 01:59 PM
  5. Userform date format reverting back to us format on change event
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-10-2009, 12:34 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