+ Reply to Thread
Results 1 to 2 of 2

END command that retains values of variables

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    END command that retains values of variables

    VBA programmers,

    I have a check for valid user input in my code that will stop the macro execution with the END command if the input is not valid. However, the END command seems to wipe out my array named speedsreb so that when the user next inputs a valid speed, a subscript out of range error occurs.


    Please Login or Register  to view this content.
    Is there a way to stop macro execution but have VBA retain all arrays and variables that have been defined up to the point of stopping?

    thanks
    Last edited by tmallin; 07-01-2014 at 04:23 PM.

  2. #2
    Registered User
    Join Date
    05-09-2013
    Location
    Michigan, USA
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: END command that retains values of variables

    Nevermind. Found the answer while continuing to search on it.

    Use "Exit Sub" instead of "End"

+ 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] Macro to enter variables to Shell Command
    By ussenterprise in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2013, 03:27 PM
  2. [SOLVED] Excel SOLVER problem, claims it is solved but retains original values. Example given.
    By ad9051 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-25-2012, 04:18 PM
  3. macro that finds variables in one column and enters values if variables found
    By xln00b in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-07-2010, 08:22 AM
  4. Using macro to enter variables to Shell Command
    By Padre in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-12-2009, 05:06 PM
  5. Using variables in the Range command
    By Chi Man Wong in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-02-2005, 12:06 PM

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