Results 1 to 19 of 19

UK and USA Date Format Issues - Userform

Threaded View

  1. #1
    Registered User
    Join Date
    04-29-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    33

    UK and USA Date Format Issues - Userform

    This seems to be a really odd problem I'm having with userforms and dates. Specifically the American date format (mm/dd/yy) being used even though the pc and excel all runs on the UK date format (dd/mm/yy).

    So here is my problem:

    I have a button on a userform that generates a new ID number and the current date for new quotes.
    At first when I used it, even though the date on my pc is 11/06/15 (dd/mm/yy), it was generating the date 06/11/15 (mm/dd/yy).
    I found a fix to that by changing the date generation to:
    txtQuotedat.Value = Format(Date, "dd/mm/yy")
    This changed the date format back to 11/06/15 and when I saved the entry it wrote it to my spreadsheet as 11/06/15 (correct).

    At this point everything seemed to be running smoothly.

    However, I also have a button for finding quotes and repopulating all the data so you can go back at a later date and fill in the blanks.
    When it finds the date from the quote on the spreadsheet and fills in the text box on the userform, it goes back to the american style 06/11/15.
    When I press save this time it saves it to my spreadsheet as the american format.

    Private Sub cmbQuote_Click()
        txtQuotenum = Cells(Rows.Count, "B").End(xlUp).Value + 1
        MsgBox ("Make sure Quote Numbers are sorted from smallest to largest to ensure a new Unique Contract Number is created!")
        txtQuotedat.Value = Format(Date, "dd/mm/yy")
    End Sub

    Does anyone have a fix for this? I need it to generate a UK format date from today's date when I press a certain button and also keep the correct format of date when pulling the date from the spreadsheet.
    Attached Files Attached Files
    Last edited by Mousiefuzz; 06-12-2015 at 05:33 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Userform Date Format Issues
    By gtbear in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-30-2014, 08:38 AM
  2. Date and Calendar issues in Userform
    By passman86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 07:18 AM
  3. Date format issues
    By robertrocks in forum Excel General
    Replies: 2
    Last Post: 11-05-2010, 01:32 PM
  4. Date format issues
    By sketchgal in forum Excel General
    Replies: 2
    Last Post: 07-20-2010, 07:33 AM
  5. date format issues
    By freekrill in forum Excel General
    Replies: 2
    Last Post: 02-16-2005, 07:52 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