Hi All
I currently have the below code as a worksheet change, however i now need it to run when a button is pressed. Can someone please help me convert it to work like that, ive tired but i keep getting an object error.
Thanks in advance
I currently have the below code as a worksheet change, however i now need it to run when a button is pressed. Can someone please help me convert it to work like that, ive tired but i keep getting an object error.
Code:
[COLOR=#333333]Private Sub Worksheet_Change(ByVal Target As Range)[/COLOR] Sheet17.Unprotect ("password")
Dim cl As Range
If Target.Column = 8 Then
For Each cl In Target.Cells
If UCase(cl.Value) = UCase("Authorised") And cl.Column = 8 Then
Range("a" & cl.Row & ":h" & cl.Row).Locked = True
Else
Range("a" & cl.Row & ":h" & cl.Row).Locked = False
End If
Next
End If
Sheet17.Protect ("password")[COLOR=#333333]End Sub[/COLOR]
Thanks in advance