Got a sheet where order entry is entered in each row, column Z of the row, "approved" is entered. When approved is entered against the order I want the worksheet to lock that row and then protect the sheet.The next orders can then be entered and each time "approved is entered in that rows column z, the row should lock.
My code is
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = "26" Then
If UCase(Target.Value) = "Approved" Then
ActiveSheet.Unprotect
Target.EntireRow.Locked = True
Target.Locked = True
ActiveSheet.Protect
End If
End If
End Sub
Bur I cant quite get it too work correctly
If Target.Column = "26" Then
Like this:
If Target.Column = 26 Then