Data enter in cell to be convert as read only

vvv999vvv

New Member
Joined
Feb 7, 2009
Messages
3
Dear,

I like to have solution,

Data once entered in cell: convert to read only
Still any other can enter data: in remaining blank cell
After enter data in new cell: become read only again
If like to change/edit in cell (having data): can be only by password

Data sheet opening encrypted by: another password
Not by Digital Signature: because sign anybody can remove

Thanks in advance & Regards

vvv999vvv
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
This is kind of basic, but it works. First, uncheck the protection box in all the cells that you want to be editable. Do this FIRST.

Then right-click on the sheettab and VIEW CODE, then paste in this code to the VBEditor Sheet:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect Password:="pwd"
    Target.Locked = True
ActiveSheet.Protect Password:="pwd"
End Sub
Now any cell that changes value will become locked, immediately.
 
Upvote 0
Pl. answer with detail -Thanks
Every step was in the post above.

  1. Uncheck the protection box in all the cells that you want to be editable.
  2. Right-click on the sheettab name
  3. Select VIEW CODE
  4. A window will appear
  5. Copy the following code from this forum into the window
    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
    ActiveSheet.Unprotect Password:="[COLOR="Red"]pwd[/COLOR]"
        Target.Locked = True
    ActiveSheet.Protect Password:="[COLOR="Red"]pwd[/COLOR]"
    End Sub
  6. Edit the password to what you want it to be, it's "pwd" in the code right now
  7. Alt-F11 to close the Editor
  8. Save your sheet
  9. Now make a change on your sheet in a cell you had unprotected
  10. Return to that same cell and try to change it again, it should stop you indicating the cell is locked.
 
Upvote 0
Another version of the code, same idea, one less line:
Rich (BB code):
Private Sub Worksheet_Change(ByVal Target As Range)
    ActiveSheet.Protect Password:="pwd", UserInterfaceOnly:=True
    Target.Locked = True
End Sub

If you don't know how to set the protection in cells:
  1. Highlight the cells you want them to be able to edit
  2. Press Ctrl-1 to open the Format Cells window
  3. Click on Protection
  4. Uncheck the "locked" box
  5. Press OK

When the sheet is protected, all cells that have that checked box will be uneditable, which is why you want to uncheck it prior to protecting the sheet. Now, anytime one of the cells you DID unlock get edited in any way, it will be locked.
 
Upvote 0
Thanks 4 ur efforts,
Still all remaining cells (with data) are not converting to read only.

May I miss someting.:confused:

any othe setting may usefull?

Regards
 
Upvote 0

Forum statistics

Threads
1,215,809
Messages
6,127,012
Members
449,351
Latest member
Sylvine

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top