After the Dim codeline add a new codeline : If ProtectContents Then Exit Sub