+ Reply to Thread
Results 1 to 2 of 2

Userform Date Format Issues

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    73

    Userform Date Format Issues

    Hi,

    I have created a user form for users to input data onto a spreadsheet. All works find but I wanted to put some error validation into it to pick up input errors. The issue I have is I can't get the CDATE function to understand an incorrect date. If the user inputs the date as 01/02/03 it will happily put 1st February 2003 - Perfect!! But if I put in 32/02/03 to generate an error the system happily puts the date as 3rd January 1932.

    Please see my code here.

    Please Login or Register  to view this content.
    Can anyone let me know where I am going wrong! Or see a better way to achieve this.
    I do not have DatePicker as an additional option in my Userform tool box and do not have admin rights on this machine to install it.

    Thank you in advance.

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

    Re: Userform Date Format Issues

    You can use IsDate to check for a valid date.

    For example.
    Please Login or Register  to view this content.

    By the way, you might want to consider checking the values in TextBoxDay, TextBoxMonth, TextBoxYear etc to see if they are valid.

    Might even be an idea to use spin buttons to restrict what goes in the textboxes.
    If posting code please use code tags, see here.

+ 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. Date and Calendar issues in Userform
    By passman86 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-01-2013, 07:18 AM
  2. MMM JJ Date Format Issues with different countries
    By wannabeexcel in forum Excel General
    Replies: 3
    Last Post: 02-10-2012, 05:54 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