+ Reply to Thread
Results 1 to 4 of 4

Get input from user using application.inputbox. Input should be number and can be 0

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Get input from user using application.inputbox. Input should be number and can be 0

    hi,

    i have a situation where i am trying to get input from the user on the number of days to add to "something". The user can input a "0"...zero...as a possible anser. The problem is this.

    I look at the value input by the user to determine if the user hit the cancel button. This i believe evaluates to False or something. My problem is that if the user hits cancel or inputs a ZERO .......they both get evaluated the same. Below is the code i am using.

    Any ideas?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Get input from user using application.inputbox. Input should be number and can be 0

    You can evaluate via TypeName function
    e.g
    Please Login or Register  to view this content.
    Returns "Boolean" when Cancel button clidked.

  3. #3
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,712

    Re: Get input from user using application.inputbox. Input should be number and can be 0

    so i should do a test like the following

    Please Login or Register  to view this content.

    What is the typename if the user input an actual number..........

    thanks for your help!

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Get input from user using application.inputbox. Input should be number and can be 0

    It should return "Double" when number is input.

    Please Login or Register  to view this content.
    You will also need to evaluate when
    Decimal, negative number etc...

+ 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