Mohamed,
Here's a starting point in VBA.
Sub LockCell()
Dim rngCell As Range
With Sheets(1)
Set rngCell = .Range("a1")
.Unprotect
.Cells.Locked = False
rngCell.Locked = True
.Protect contents:=True
End With
End Sub
Robin Hammond
www.enhanceddatasystems.com
"Mohamed" wrote in message
...
How to lock a cell which contains a formula