+ Reply to Thread
Results 1 to 4 of 4

Exit Sub if Inputbox cancel, X Button or blank value is used (bypass debug)

  1. #1
    Registered User
    Join Date
    12-21-2012
    Location
    oxford
    MS-Off Ver
    MS-Off 2010 & 2016
    Posts
    16

    Exit Sub if Inputbox cancel, X Button or blank value is used (bypass debug)

    a colleague bought it to my attention, i have placed an admin button in the spreadsheet that removes all protections freeing it up for modification to those that have been given the password, however when a NULL value is entered or the cancel or X button is hit, it goes to debug and end users can see the password.

    i have the below string however it doesnt quite work, i have always struggled with IFs

    Please Login or Register  to view this content.
    the 2 x ElseIf is what i have added unfortunately it really doesnt like it.

    Many Thanks

    Liam

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Exit Sub if Inputbox cancel, X Button or blank value is used (bypass debug)

    Those tests are in the wrong place:
    Please Login or Register  to view this content.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Exit Sub if Inputbox cancel, X Button or blank value is used (bypass debug)

    Good afternoon liamtimms1985

    Use Application.Inputbox instead :
    Please Login or Register  to view this content.
    HTH

    DominicB

  4. #4
    Registered User
    Join Date
    12-21-2012
    Location
    oxford
    MS-Off Ver
    MS-Off 2010 & 2016
    Posts
    16

    Re: Exit Sub if Inputbox cancel, X Button or blank value is used (bypass debug)

    thank you so much..... a pair of legends!

+ 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. Inputbox - formatted as Date, unable to exit sub on Cancel
    By Lewis Smeby in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2015, 05:27 PM
  2. [SOLVED] Exit Sub on InputBox Cancel
    By qwerty7 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-01-2015, 07:33 PM
  3. InputBox OK and Cancel Button Problem
    By mackypogi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-26-2014, 07:51 PM
  4. cancel button Application.Inputbox
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-20-2014, 02:30 PM
  5. 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
  6. add cancel button to inputbox
    By SarahPintal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2011, 02:27 AM
  7. Inputbox cancel button error.
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-05-2010, 06:27 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