+ Reply to Thread
Results 1 to 8 of 8

Input Box Cancel Button

  1. #1
    Registered User
    Join Date
    09-21-2016
    Location
    Scottsdale, AZ
    MS-Off Ver
    2016
    Posts
    34

    Input Box Cancel Button

    Below is one of the variations of code I have tried to use in order to get my the cancel button on the inputbox to not run the rest of the code in the sub.

    Im not out of ideas and could use some help. Please and thank you.



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Input Box Cancel Button

    Sorry removed post. Code not working!
    Last edited by DBY; 09-26-2016 at 02:25 PM.

  3. #3
    Registered User
    Join Date
    09-21-2016
    Location
    Scottsdale, AZ
    MS-Off Ver
    2016
    Posts
    34

    Re: Input Box Cancel Button

    It worked to an extent, so I was trying to play with it myself because it was definitely closer than what I got.

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Input Box Cancel Button

    Hi
    Try this:

    Please Login or Register  to view this content.
    Originally I hadn't allowed for the Message box option. Here I just put the response value in to A1 as a test but adapt as required.

    DBY

  5. #5
    Registered User
    Join Date
    09-21-2016
    Location
    Scottsdale, AZ
    MS-Off Ver
    2016
    Posts
    34

    Re: Input Box Cancel Button

    That works perfectly, thank you, I have been missing with that code for like 2 hours.

  6. #6
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Input Box Cancel Button

    Glad to have helped. It wasn't as easy as I first thought, hence I removed my first post. The 'Type:=2' options seems to make the difference. Thanks for the Rep mark.

  7. #7
    Registered User
    Join Date
    09-21-2016
    Location
    Scottsdale, AZ
    MS-Off Ver
    2016
    Posts
    34

    Re: Input Box Cancel Button

    Glad to give it to you.

    If you don't mind answering me this, what does the Type:=2 mean. I understand most of the code but this throws me off.

  8. #8
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Input Box Cancel Button

    I found my information here:

    http://theitservice.co.uk/blog/input...od-and-strptr/

    There is a way with the strptr() function but as it's not supported by Microsoft anymore I thought it was best avoided. There's a list of Type parameters half way down the page. The one I chose Type 2 returns a text string.

    Hope this helps.

+ 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] Problem with CANCEL button, INPUT BOX
    By GIS2013 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2014, 04:26 PM
  2. [SOLVED] Input box and the cancel button
    By Saturn in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2014, 01:21 PM
  3. [SOLVED] Input Box must be integer, Cancel button type mismatch
    By Nrowell92 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-30-2012, 03:29 PM
  4. Cancelling an inputbox if blank input or cancel button is pressed
    By kathhying in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2011, 12:07 PM
  5. Cancel button on input box causes crash
    By EGR2317 in forum Excel General
    Replies: 8
    Last Post: 06-04-2010, 09:51 AM
  6. Cancel button to cancel the whole macro
    By excelnut1954 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-17-2006, 04:30 PM
  7. input box - I don't need the "cancel" button
    By Paula in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-04-2005, 11:40 AM

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