Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro that calls a Form on an error. This form gives the user the
choice of Continueing or Exiting. If the Continue button is selected how do i get the focus (after unloading the form) to return to a particular part of the macro; as one would with a GoTo command in a macro. i want to return to the calling macro but at a different place from where the form is called. Any advices will be gratefully received. many thanks -- with kind regards Spike |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Spike" wrote: I have a macro that calls a Form on an error. This form gives the user the choice of Continueing or Exiting. If the Continue button is selected how do i get the focus (after unloading the form) to return to a particular part of the macro; as one would with a GoTo command in a macro. i want to return to the calling macro but at a different place from where the form is called. Any advices will be gratefully received. Hi Spike, The cleanest way to do this would be to have a seperate Sub for the macro at the new entry point. For example, if you wanted to skip a chunk of code, you would work along the lines below: Old code: DoSomeStuff If error then displaycontinueform DoSomeOtherStuff DoEvenMoreStuff New code: Do some stuff If error then displaycontinueform If UserClicksContinue then RunFromThisPoint DoSomeOtherStuff RunFromThisPoint Sub RunFromThisPoint DoEvenMoreStuff End Sub I hope this helps -- TimB |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Goto Button | Excel Programming | |||
Attaching a macro to a VB button on a form | Excel Worksheet Functions | |||
Pause macro, add form button to sheet, continue macro when button clicked! | Excel Programming | |||
Macro to activate form button | Excel Programming | |||
Goto method fails when assigning a macro to a button | Excel Programming |