Prevent formula entry
"NickHK" wrote...
Nothing built-in, but you can check either at the WS or WB level:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
Application.EnableEvents = False
For Each Cell In Target.Cells
If Cell.HasFormula = True Then
Cell.Value = ""
MsgBox "No formulae allowed"
End If
Next
Application.EnableEvents = True
End Sub
Note that this can be defeated easily by disabling macros.
Personally, I can't think of any good reason to prevent users from making
any valid entries, constants or formulas. It won't prevent users from trying
to find values in hidden worksheets/rows/columns. All they'd need to do is
open a new workbook and enter formulas with external references into the
'protected' workbook.
|