Exit a macro from an error condition

  • Thread starter Thread starter ChuckM
  • Start date Start date
C

ChuckM

Is there a way to exit a program during it's execution. I want to
check if a condition is met...if not, then exit the program.
thanks
chuckm
 
Chuck,


You can use the Exit Sub statement to exit the current procedure.
E.g.,

If whatever = False Then
Exit Sub
End If
 
Chuck,

Sure can....
What condition are you checking for??

If range("A1") = "abc" Then Exit Sub

John
 
Back
Top