This should protect any sheet where C1 contains data and unlocks D1 where "Cancelled" could be noted. The code will create a random 16 character password which you cannot recover.
Option Explicit
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim sh As Worksheet, x As Boolean, p As String, i&
For i = 1 To 16
p = p & Chr(Application.RandBetween(33, 255))
Next i
For Each sh In Worksheets
x = Not (sh.ProtectContents)
If sh.Range("C1") <> "" And x Then
sh.Range("D1").Locked = False
sh.Protect Password:=p
End If
Next
End Sub