+ Reply to Thread
Results 1 to 4 of 4

Inputbox - force an actual date

  1. #1
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Inputbox - force an actual date

    I want my macro to tell the user that if they put in anything other than a date in the MMM YYYY format there is a message that tells them so.

    Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Inputbox - force an actual date

    Hi,

    Assuming that MMM and YYYY are month and year values, rather than try and validate the contents of an Input box, why not provide a couple of List Boxes from which they can choose the only allowable options. Then there is no doubt. e.g. a box with 'Jan', 'Feb', 'Mar' etc. and another with '2012;, '2013', '2014' etc.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Inputbox - force an actual date

    nickmax1,

    I agree with what Richard has suggested. However, I had already put this code together by the time he posted, so I figured I'd post it instead of just deleting it:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Valued Forum Contributor
    Join Date
    08-10-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    721

    Re: Inputbox - force an actual date

    that is absolutely perfect....just what i wanted.

    thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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