+ Reply to Thread
Results 1 to 4 of 4

date function

  1. #1
    Registered User
    Join Date
    02-09-2015
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    7

    date function

    Okay i have a userform that staff will be inputing Name in first textbox, date in 2nd text, etc.
    I'm trying to figure out a way to force the date to show just month and day. For instance
    User types date as
    04102015
    I would want it to show 04/10

    User types
    4-10-15
    I would still want it to show 04/10

    I think there might be to many variables to deal with. But i'm unsure.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: date function

    Dealing with free-form user date input can get complicated. You would be better off using two combo boxes with a list of months and a list of days to pick from. Then you don't have to parse user input and you don't have to reformat dates. The user never even gets a chance to enter a year.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    02-09-2015
    Location
    Earth
    MS-Off Ver
    2013
    Posts
    7

    Re: date function

    I didn't even think of that. Thanks

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: date function

    Here's sample code. You still have to check to see if it forms a valid date (i.e., can't allow April 31, can't allow February 29 unless it's a leap year).

    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. Replies: 4
    Last Post: 06-12-2014, 11:37 AM
  2. Replies: 2
    Last Post: 05-21-2014, 02:26 PM
  3. [SOLVED] Function/formula to compare and insert todays date or yesterdays date
    By TC922 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-17-2013, 05:28 AM
  4. Replies: 0
    Last Post: 05-30-2013, 07:50 PM
  5. [SOLVED] Date function that compare 2 date in single column and return value
    By alimamak in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-20-2012, 06:45 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