+ Reply to Thread
Results 1 to 3 of 3

Input Box must be integer, Cancel button type mismatch

  1. #1
    Registered User
    Join Date
    04-30-2012
    Location
    Massachusetts, US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Input Box must be integer, Cancel button type mismatch

    Hello,

    I am fairly new to coding so may not be aware of an easier way to do this, but the gist of my problem is that I am trying to have the user input an integer that I have declared as an integer x. Everything works fine if the user inputs an integer but in the case where they put in anything but an integer or hit cancel you'd get a type mismatch error. I've read many threads on restricting a user to integer entry but haven't found anything that solves the cancel problem, as on cancel it returns FALSE and gives a type mismatch error. So now I have resorted to pulling my hair out, as this is for now only being used by me but I'd like to make this macro easy to use for the average user. Any help would be greatly appreciated. I'll include some sample code from the Sub to let you know exactly what I am dealing with.

    Please Login or Register  to view this content.
    Nick

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,646

    Re: Input Box must be integer, Cancel button type mismatch

    Please Login or Register  to view this content.
    See Help for InputBox Method
    Last edited by shg; 04-30-2012 at 07:54 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    04-30-2012
    Location
    Massachusetts, US
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Input Box must be integer, Cancel button type mismatch

    shg that worked perfectly! I had actually forgot about the type selection, as I haven't used it before. I'm glad this was a simple fix and greatly appreciate your prompt response! Thanks a bunch

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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