+ Reply to Thread
Results 1 to 4 of 4

Input box - cancel button

  1. #1
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Input box - cancel button

    Hello All,

    I need some help writing a few lines that exits the sub if the users clicks the cancel button...........tried and am failing miserably!

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Input box - cancel button

    Try changing the variable s_row to String, then add one line of code as shown below:
    Please Login or Register  to view this content.
    You may also want to add a check to confirm the string entered is a valid number (when converted from string to number), otherwise the remaining code may fail.

  3. #3
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Re: Input box - cancel button

    That worked perfect! I agree with you about validating the other data. The user needs to select data within a specified table, how could I achieve that?

  4. #4
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Input box - cancel button

    Something like this will check a range of cells to see if the value exists. If it does, you can proceed with your code in the Else portion of the IF statement.
    Please Login or Register  to view this content.

+ 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 my cancel button on my input box
    By danbates in forum Excel General
    Replies: 7
    Last Post: 01-23-2017, 06:35 AM
  2. [SOLVED] Input Box Cancel Button
    By underwater24 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-26-2016, 05:08 PM
  3. [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
  4. [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
  5. [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
  6. 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
  7. Cancel button on input box causes crash
    By EGR2317 in forum Excel General
    Replies: 8
    Last Post: 06-04-2010, 09:51 AM

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