View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tim Zych[_7_] Tim Zych[_7_] is offline
external usenet poster
 
Posts: 21
Default I want to protect a cell but allow formula values only

In the sheet's change event undo any non-formula entry.
Might be difficult to implement in the real world for a variety of reasons
but here's a start.

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Target(1, 1).HasFormula Then
Application.Undo
End If
End Sub

"Fredy A." wrote in message
...
Hello, i have a worksheet with some formulas in it. I
have the sheet protected, but there are some cells i
cannot protect because if i do, values calculated by
formulas will not populate them. When i leave them
unprotected, there is a risk of people typing their own
value in and erasing the formula. How can i truly protect
my sheet? I want to alllow data to be populated in
certain cells, but only by formulas, not by a user typing
in whatever they want. Your help greatly appreciated.