Thread: Lock cell
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Robin Hammond[_2_] Robin Hammond[_2_] is offline
external usenet poster
 
Posts: 575
Default Lock cell

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