Cell blocking

Closed
Moon Spell - Sep 14, 2015 at 07:13 AM
TrowaD Posts 2900 Registration date Sunday September 12, 2010 Status Moderator Last seen September 12, 2022 - Sep 15, 2015 at 11:39 AM
Hello,
i need to block the cell after entering data to it
which means i need each cell to accept entry one time only
note.the worksheet must be protected
ths all



1 reply

TrowaD Posts 2900 Registration date Sunday September 12, 2010 Status Moderator Last seen September 12, 2022 523
Sep 15, 2015 at 11:39 AM
Hi Moon Spell,

Start by unblocking all cells:
Hit Ctrl + a to select all cells.
Hit Ctrl +1 to go to cell properties.
Go to the protection tab and uncheck the blocked box.
Hit OK.

Now implement the code below by right-clicking the sheets tab and select view code. Paste the code in the big white field.
Private Sub Worksheet_Change(ByVal Target As Range)
ActiveSheet.Unprotect
Target.Locked = True
ActiveSheet.Protect
End Sub


Now you will only be able to input a value once. Unless you manually unprotect the sheet.

Best regards,
Trowa
0