+ Reply to Thread
Results 1 to 7 of 7

input numeric values only on textbox

  1. #1
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    input numeric values only on textbox

    hi,

    anyone knows who can restrict the input values to numeric values only? I have 2 textboxes where the user enters employee id and numeric choice value of 1,2 and 3...I need help in making the textboxes restricted to numeric values input only. Please help me in preventing the users from entering alpha and symbols values. I appreciate any response. Thanks

    Stoey
    Last edited by stoey; 03-05-2009 at 02:22 PM.

  2. #2
    Registered User
    Join Date
    10-07-2008
    Location
    United Kingdon
    Posts
    7

    Re: input numeric values only on textbox

    Do you need to use a testbox? You can do this quite easily in a cell using Data validation.

    If you must use a textbox you could probably test the contents with IsText or IsNumber or IsNonText functions.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: input numeric values only on textbox

    Is this on a userform?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: input numeric values only on textbox

    hi,

    thanks for responding...currently i have a userform which has 2 textboxes...one for entering employee id and one for entering numeric choice values of 1,2 and 3....do you an idea how to do this using macro?

    thanks,

    stoey

  5. #5
    Forum Contributor
    Join Date
    02-19-2005
    Location
    Gurgaon,India
    MS-Off Ver
    2007,2010,2013
    Posts
    180

    Re: input numeric values only on textbox

    Hi,

    Try

    Please Login or Register  to view this content.
    Kris

  6. #6
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: input numeric values only on textbox

    hi there,

    thanks for the coding...it worked however, when i enter values with zero, it doesn't work....employee ids have zero values when being entered...my employee ids contains 5 digits (some includes zero number like 60740)...any idea how i can include the zero number on the set of keyascci?

    thanks,

    stoey

  7. #7
    Forum Contributor
    Join Date
    08-07-2008
    Location
    United States
    MS-Off Ver
    Microsoft Office 2003
    Posts
    362

    Re: input numeric values only on textbox

    hi again,

    thanks kris...the code you provided work well now...i change the asci value to 48 which is equals to zero...now i can use zero values on the employee ids...thanks again... however i have another problem which i think it needs to be posted on another thread...thanks a lot again.


    stoey

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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