Allow only writing in a protected Sheet


P

Piruzzi

Hello,
Can anyone tell me if its possible to allow only writing in a cell when a
sheet is protected?
For Example: I have a column named "Names" and in this Column is allowed to
write the persons name and then you can't delete it, or modified it, unless
you have the password to unprotect.
Is this possible?
I aprecciate the help.

Thanks in advance
Piruzzi
 
Ad

Advertisements

G

Gord Dibben

First you select all cells you want to be able to enter data in and Format
to Unlocked.

Then add this event code to the sheet module.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then 'edit the 1 to your column number
Me.Unprotect Password:="justme"

With Target
If .Value <> "" Then
.Locked = True
End If
End With
End If

enditall:
Me.Protect Password:="justme"
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top