+ Reply to Thread
Results 1 to 2 of 2

VBA . validating user entered data (via inputbox) and error handler

  1. #1
    Forum Contributor
    Join Date
    01-29-2011
    Location
    Bristol, England
    MS-Off Ver
    Excel 2003
    Posts
    471

    VBA . validating user entered data (via inputbox) and error handler

    Hi all
    I have this code where the first inputbox asks the user to insert year e.g. 2011 and second inputbox asks to enter week number e.g. 52.
    How can validate that user indeed selected the a valid year number lets say number between 2000 and 2100 (yes I believe no one will use excel in its current form after 2100 ), and with week number it can be number between 1 and 52. Error handler should exit the sub and prompt with a message. Like "not a valid year" or "not valid week number"

    Code itself looks following:
    Please Login or Register  to view this content.
    If anyone knows how to do it, I would appreciate the help.
    Cheers
    Rain

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: VBA . validating user entered data (via inputbox) and error handler

    Hi rain, try to incorporate this into your procedure
    Please Login or Register  to view this content.
    I would but I am now leaving the building.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ 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