+ Reply to Thread
Results 1 to 6 of 6

Only Numeric Value in Input Box?

  1. #1
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299

    Only Numeric Value in Input Box?

    How can I edit the following code so that the user can only enter a numeric value in the input box? If it is not completely numeric I would like the user to know it has to be numeric and to try again. Everything else is exactly how I need it.
    Thank you very much for your time and help.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Need to use
    Please Login or Register  to view this content.
    . Link explains more

    http://www.ozgrid.com/VBA/inputbox.htm

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    I changed the code to reflect the "application.inputbox", and now when a user enters text the macro exits the sub, which is better, but I need it to say enter number, and let user try again???
    any ideas?
    Thank you for your time and help.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Did you read the link.

    You can define what is allowed out of the following. The below example is set up to accept numbers

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Forum Contributor
    Join Date
    02-20-2007
    MS-Off Ver
    2003 & 2007
    Posts
    299
    thank you for the clarification:

    This did the trick:

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    No problem

    VBA Noob

+ 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