Grizlore
Active Member
- Joined
- Aug 22, 2006
- Messages
- 259
Hi, i am sure this is something simple.
Could anyone tell me why this code isnt working please?
Basically, i should lock the entire row IF the word "completed" is in column "O"
Any help would be appreciated
Could anyone tell me why this code isnt working please?
Basically, i should lock the entire row IF the word "completed" is in column "O"
Code:
Sub Lock_Completed()
Application.ScreenUpdating = False
With Sheets("AUDITS")
.Unprotect "password"
.Cells.Locked = True
With .Columns("O")
.AutoFilter Field:=1, Criteria1:="<>Completed"
On Error Resume Next
.SpecialCells(xlCellTypeVisible).EntireRow.Locked = True
On Error GoTo 0
End With
.ShowAllData
.Protect "password"
End With
Application.ScreenUpdating = True
End Sub
Any help would be appreciated