Hello,
I have a spreadsheeet that's used as a sign-up sheet. The goal is for a user to be able to enter data (their name) into a cell, then lock it to prevent another user from making changes to that same cell. My code works perfectly until I share the workbook. When it's shared, it seems to completely ignore the events. And since it's shared, the code is locked, making it impossible to step though.
Does anyone have any suggestions on how I can get the code to work in shared mode? Or is there another way to restrict data after the first entry?
Thanks in advance,
Omar
I have a spreadsheeet that's used as a sign-up sheet. The goal is for a user to be able to enter data (their name) into a cell, then lock it to prevent another user from making changes to that same cell. My code works perfectly until I share the workbook. When it's shared, it seems to completely ignore the events. And since it's shared, the code is locked, making it impossible to step though.
Does anyone have any suggestions on how I can get the code to work in shared mode? Or is there another way to restrict data after the first entry?
Thanks in advance,
Omar
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.DisplayAlerts = False
If Target.Value = Empty Then
ActiveSheet.Unprotect
Else:
ActiveCell.Locked = True
ActiveSheet.Protect
End If
Application.DisplayAlerts = True
End Sub