[RESOLVED] Excel Conundrum
Hi All,
I'm trying to get this code to work, I'm stuck on the first hurdle, I'm trying to get the below to lock each cell after a user enters a value, but I can't get it to work.
The only ranges a user would need to fill in once are:
C8 - F12
C23 - F27
C38 - F42
C53 - F57
Code:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 2 Then
ActiveSheet.Unprotect Password:="justme"
N = Target.Row
If Excel.Range("B" & N).Value <> "" Then
Excel.Range("B" & N).Locked = True
End If
End If
enditall:
ActiveSheet.Protect Password:="justme"
Application.EnableEvents = True
End Sub