View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default Only allow users to edit in sheet, not delete any entries entered

You can use a Worksheet_Change event macro that will prevent ANY entry other
than a blank cell from being changed. Something like the following. Note
that this macro must be placed in the sheet module of the pertinent sheet.
HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CountAfter As Long
If Target.Count 1 Then
CountAfter = Application.CountA(Target)
Application.EnableEvents = False
If CountAfter = 0 Then
Application.Undo
MsgBox "Clearing of cells is not permitted.", 16, "ERROR"
End If
Application.EnableEvents = True
Exit Sub
End If
If IsEmpty(Target.Value) Then
Application.EnableEvents = False
Application.Undo
MsgBox "Clearing of cells is not permitted.", 16, "ERROR"
Application.EnableEvents = True
End If
End Sub
"rrupp" wrote in message
...
Is there a way to protect data in Excel so users can enter information but
not delete information that has been entered by other users in the cell.
In
other words, I'll be distributing a document for users to edit, I want to
protect it so users who have entered data, cannot have someone else delete
what they entered. Any easy way to do this?

Thanks for your time.