ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Lock cell entry (https://www.excelbanter.com/excel-worksheet-functions/55983-lock-cell-entry.html)

Sprankler

Lock cell entry
 
Is there a way to prevent changing, or re-entering data in an Excel cell
after initial entry?

Bernie Deitrick

Lock cell entry
 
Sprankler,

Copy the code below, right click on the sheet tab, select "View Code" and paste the code in the
window that appears.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Target.Locked = True
ActiveSheet.Protect
End Sub

"Sprankler" wrote in message
...
Is there a way to prevent changing, or re-entering data in an Excel cell
after initial entry?





All times are GMT +1. The time now is 12:24 AM.

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