+ Reply to Thread
Results 1 to 4 of 4

Aborting code after a MsgBox has been clicked

  1. #1
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    Aborting code after a MsgBox has been clicked

    Hi

    I am using an If function to test for incorrect input (for instance, when the input is too high). A MsgBox then appears saying "The value is too high". When the user clicks "OK", I want my code to stop. How do I do this?

    Thanks
    Luke

  2. #2
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Aborting code after a MsgBox has been clicked

    Hi Luke
    Something like this will do it. Enter a number in A1, the message box appears & quits the routine after OK is pressed
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-11-2014
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Aborting code after a MsgBox has been clicked

    Thank you! Precisely what I was looking for!

  4. #4
    Valued Forum Contributor
    Join Date
    08-22-2011
    Location
    Auckland
    MS-Off Ver
    Excel 2019
    Posts
    716

    Re: Aborting code after a MsgBox has been clicked

    That's good

+ 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] code so that when a cell is clicked, a tick mark goes in the cell that was clicked
    By behnam in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-08-2013, 01:17 PM
  2. Need to run macros depending on msgbox button clicked
    By rosshkerr in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-01-2012, 06:07 AM
  3. Aborting code execution
    By nymm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-12-2011, 04:43 AM
  4. msgbox apear if macro clicked
    By shilpz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-17-2008, 06:49 PM
  5. Aborting a Sub procedure from a UserForm
    By shellshock in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-01-2005, 09:05 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