Hi all
I am looking to exit a Sub (actual code is way too long to post here so just an example below) via a macro when the user presses a button.
The sort of Sub (without all the extra code) is similar to the below code - just runs from top to bottom and then jumps back up to the start again - an endless loop only stoppable by the user.
I had thought of just having a macro that changes a boolean variable (in this case Pressed) to true when run (via the button) but I cannot get the macro to execute (via the button) whilst the loop below is working.
I really need to user to be able to stop this Sub so any help is very much appreciated.
Redders
Sub looper ()
Startagain:
(all other code goes here)
If Pressed = True then Goto Leave
Goto Startagain
Leave:
Exit Sub
Bookmarks