Morning
Am self teaching myself VBA but am stuck on this one. Receiving an error when I run the macro 'Run-time error 424 Object required'.
Can anyone look at this and tell me what I am missing please? It is highlighting the second line.
Private Sub CheckBox15_Click()
If CheckBox15.Value = True Then
ActiveSheet.Unprotect ("password")
Range("A20:s46").Interior.ColorIndex = 15
Range("A20:s46").Locked = True
ActiveSheet.Protect ("password")
End If
If CheckBox15.Value = False Then
ActiveSheet.Unprotect ("password")
Range("A20:s46").Interior.ColorIndex = 0
Range("A20:s46").Locked = False
ActiveSheet.Protect ("password")
End If
End Sub
Am self teaching myself VBA but am stuck on this one. Receiving an error when I run the macro 'Run-time error 424 Object required'.
Can anyone look at this and tell me what I am missing please? It is highlighting the second line.
Private Sub CheckBox15_Click()
If CheckBox15.Value = True Then
ActiveSheet.Unprotect ("password")
Range("A20:s46").Interior.ColorIndex = 15
Range("A20:s46").Locked = True
ActiveSheet.Protect ("password")
End If
If CheckBox15.Value = False Then
ActiveSheet.Unprotect ("password")
Range("A20:s46").Interior.ColorIndex = 0
Range("A20:s46").Locked = False
ActiveSheet.Protect ("password")
End If
End Sub