shadow12345
Well-known Member
- Joined
- May 10, 2004
- Messages
- 1,238
I have a rather large macro that controls a number of functions. I have just been informed that one the things I evualate should cause the entire process to stop if it equals "F".
I know the Exit sub command, but this proceedure is called from within others, I am wondering if I can stop all macros running without having to evaulate the variable right at the start of the macro. Example below
Sub selectcorrectstyle()
Dim contract As String
Dim exchange As String
Dim ref
Dim contracttype As String
Dim contracttypefind As Long
Sheets("Current day").Select
ref = Range("a1")
contracttype = Mid(ref, 2, 1)
contracttypefind = InStr(1, ref, contracttype)
exchange = Left(ref, 1)
'contract = mid(ref,(instr(1,ref,contracttype)
contract = Trim(Mid(ref, contracttypefind + 1))
If contracttype = "O" Then Exit Sub
If contracttype = "F" Then MsgBox "other procedure call goes here"
End Sub
How could insted of exit sub, have exit all macros? (or am I stuck and ill have to check this earlier?)
I know the Exit sub command, but this proceedure is called from within others, I am wondering if I can stop all macros running without having to evaulate the variable right at the start of the macro. Example below
Sub selectcorrectstyle()
Dim contract As String
Dim exchange As String
Dim ref
Dim contracttype As String
Dim contracttypefind As Long
Sheets("Current day").Select
ref = Range("a1")
contracttype = Mid(ref, 2, 1)
contracttypefind = InStr(1, ref, contracttype)
exchange = Left(ref, 1)
'contract = mid(ref,(instr(1,ref,contracttype)
contract = Trim(Mid(ref, contracttypefind + 1))
If contracttype = "O" Then Exit Sub
If contracttype = "F" Then MsgBox "other procedure call goes here"
End Sub
How could insted of exit sub, have exit all macros? (or am I stuck and ill have to check this earlier?)