+ Reply to Thread
Results 1 to 4 of 4

Date format in textbox userform

  1. #1
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Date format in textbox userform

    Hi,

    In certain cases my textbox will be automatically filled with a date thats been called in the line below
    Please Login or Register  to view this content.
    in this cell, the date is set as dd-mm-yyyy but it appears as mm-dd-yyyy in the textbox.

    So in the cell it's like 12-01-2016
    When the textbox is filled it changes to 01-12-2016.

    How can this be prevented so the textbox will also show the date as dd-mm-yyyy?

    Thanks for the help!!

    Rrgds,
    Crispy
    Last edited by Crispy85; 11-02-2016 at 06:41 AM.

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

    Re: Date format in textbox userform

    Use the cell TEXT property rather than the Value property - this will insert the formatted text as displayed in the cell.

  3. #3
    Forum Contributor
    Join Date
    06-14-2013
    Location
    jk
    MS-Off Ver
    Excel 2007
    Posts
    326

    Re: Date format in textbox userform

    Thanks!
    This seems to work!

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

    Re: Date format in textbox userform

    Nothing to do with your original questionm, but make sure you write it back as a Date and not Text. Excel will try to coerce text that 'looks like' a date to a date using the mm/dd/yy format so you'll end up with American format dates in the cell.

    Rather than
    Please Login or Register  to view this content.
    Use
    Please Login or Register  to view this content.

+ 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 question
    By Crispy85 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-08-2016, 03:44 AM
  2. [SOLVED] Userform TextBox Date Format Keeps Auto Updating
    By unit285 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-04-2016, 06:09 PM
  3. [SOLVED] Excel 2010 - Userform - display date from textbox in a label or textbox in 'ddd' format
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2015, 10:54 PM
  4. [SOLVED] Userform Textbox Date Format
    By saban1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-12-2014, 10:52 AM
  5. [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
  6. Date Format in userform textbox is different from excel worksheet?
    By z-eighty2 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2013, 06:46 AM
  7. Date Format for textbox in userform
    By processchip in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-08-2011, 06:42 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