ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   Allow only writing in a protected Sheet (https://www.excelbanter.com/setting-up-configuration-excel/215374-allow-only-writing-protected-sheet.html)

Piruzzi

Allow only writing in a protected Sheet
 
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

Gord Dibben

Allow only writing in a protected Sheet
 
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

On Mon, 5 Jan 2009 11:45:02 -0800, Piruzzi
wrote:

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




All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com