+ Reply to Thread
Results 1 to 7 of 7

Want to apply only numbers in textboxes userform in simple way

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Want to apply only numbers in textboxes userform in simple way

    hi, everyone
    i found a code for textoboxes pass only numbers to sheet

    Please Login or Register  to view this content.
    but i have 105 textboxes,

    so i want a simple way to numbers only in textboxes


    thanx
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

  2. #2
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Want to apply only numbers in textboxes userform in simple way

    HaroonSid:

    There are 2 ways...
    #1: You still make a Exit event for every box, but each calls ONE sub that does the checking... You will need the same Exit for every box.
    Please Login or Register  to view this content.
    or #2: You add all the textboxes to a class, but you would need a class module and I suspect that is a bit advanced for now. If you want to post the file then I could see if I can make some time to do it for you, if you tell me which textboxes on which form need to behave this way.
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Want to apply only numbers in textboxes userform in simple way

    Add this to a Class Module. Change the class name from Class1 to clsNumericTextBox. Code only allows for Numeric keys to be entered into any textbox on userform.

    Please Login or Register  to view this content.
    Add this to your Userform Module

    Please Login or Register  to view this content.
    Last edited by mike7952; 01-25-2017 at 01:55 PM.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Want to apply only numbers in textboxes userform in simple way

    @mike, nice code

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Want to apply only numbers in textboxes userform in simple way

    Thanx A lot for the quick response both of you

    @Arkadi
    thanx a lot for quick and good knowledge for me of multiple method to do the same thing

    @mike7952
    your code is working as i need but there is one lose point that its not picking the .125 (decimals) otherwise if working

    plz solve the decimals,

    because i need to put sometime decimal vlaues

    thanx a lot both of you once again

  6. #6
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Want to apply only numbers in textboxes userform in simple way

    In the Class Module just add 46

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Want to apply only numbers in textboxes userform in simple way

    Yes
    perfectly

    thanx, very very thanx
    dear @mike7952

+ 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. [SOLVED] Change Number format of textboxes in simple way
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2017, 02:03 PM
  2. [SOLVED] Sum textboxes numbers in a userform.
    By MariaPap in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2013, 01:14 PM
  3. Creating loop to apply to multiple textboxes
    By acwhite42 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-04-2013, 11:53 AM
  4. Help Populating Textboxes in Userform, With Multipage Userform.
    By mdmorgan24 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2012, 05:29 PM
  5. UserForm Knowledge needed to make TextBoxes in both places as numbers
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-20-2012, 11:34 AM
  6. [SOLVED] Userform- Formating numbers in Textboxes
    By Ozgur Pars in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2006, 05:10 AM
  7. [SOLVED] UserForm TextBoxes
    By Rob in forum Excel General
    Replies: 2
    Last Post: 08-05-2005, 10:07 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