You can use public variable for this.
Here's an example.
In a standard module (where "Main" code is if it's in one) put this at the very top of the
module:
Then to modify your existing "Main" code you can do something like this.
Code:
Sub Main()
'At the beginning of "Main" macro code
Halted = 0
'Continue your "Main" macro code with what's supposed _
to execute before the FrmMenu gets called.
'Just above the point at which you want the code _
execution to stop if Cancel has been pressed. . .
If Halted <> 0 Then Exit Sub
'The remainder of your "Main" macro code
End Sub
Short of this helping then as texasalynn suggests, perhaps you can post your existing
code and we can help from there.
Hope it helps.