+ Reply to Thread
Results 1 to 2 of 2

VBA Userform - Restrict Text Box to integers between 18 - 80

  1. #1
    Forum Contributor
    Join Date
    01-06-2011
    Location
    cleveland
    MS-Off Ver
    Excel 2007
    Posts
    225

    VBA Userform - Restrict Text Box to integers between 18 - 80

    i am attempting to learn userforms for the first time to try and make things a little more presentable than having users fill out excel cells. in textbox "TextBoxAge", i am trying to restrict the user to inputting values between these values.

    right now, i found this very useful code that only allows integers to be pressed

    Please Login or Register  to view this content.
    but it will obviously allow for an age of 10000.

    can anybody point me in a direction to allow me to restrict the values so that if the age exceeds 80, it will beep?

    im sure there is probably a better way (like a scroll bar maybe?), but like i said - this is my first project with userforms so please excuse my ignorance on the subject

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: VBA Userform - Restrict Text Box to integers between 18 - 80

    try this: 18-80.xlsm
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

+ 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