Quote Originally Posted by gmaxey View Post
Sub NamedMacro()
If Not Checkbox.Checked then Exit Sub
'The rest of your code.

End If
Thanks Gmaxey.

Now I have made a Checkbox (Checkbox1) in a userform (Userform1). I have put your macro on top of existing macro (The macro makes three line shift if i press hotkey F9). It looks like this:
Sub TestMacro ()
If Not Checkbox1.Checked Then Exit Sub
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeParagraph
End Sub
When I run this macro, an error occurs saying "variable not defined" and reffers to Checkbox1.

What may be wrong?



Gmayor: This document in not used for day to day writing, but for interpreting from spoken language to text. In this job correct punctation don't apply :-)