im trying to run the code below to activate a macro depending on the
selction made in the dropdown in cell b5
if i take the protection off manually it works fine, however if the protection is on as required
it fails to unprotect it and throws up the protected message
any help appreciated
-------------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Application.ScreenUpdating = False
Sheets("DASHBOARD").Select
ActiveSheet.Unprotect Password:="CORLEONE"
If Target.Address(False, False) = "B5" Then
Select Case Target.Value
Case "SHIFT 01": Call SHIFT01
Case "SHIFT 02": Call SHIFT02
Case "SHIFT 03": Call SHIFT03
Case "SHIFT 04": Call SHIFT04
Case "SHIFT 05": Call SHIFT05
Sheets("DASHBOARD").Select
ActiveSheet.Protect Password:="CORLEONE"
End Select
End If
End Sub
selction made in the dropdown in cell b5
if i take the protection off manually it works fine, however if the protection is on as required
it fails to unprotect it and throws up the protected message
any help appreciated
-------------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Application.ScreenUpdating = False
Sheets("DASHBOARD").Select
ActiveSheet.Unprotect Password:="CORLEONE"
If Target.Address(False, False) = "B5" Then
Select Case Target.Value
Case "SHIFT 01": Call SHIFT01
Case "SHIFT 02": Call SHIFT02
Case "SHIFT 03": Call SHIFT03
Case "SHIFT 04": Call SHIFT04
Case "SHIFT 05": Call SHIFT05
Sheets("DASHBOARD").Select
ActiveSheet.Protect Password:="CORLEONE"
End Select
End If
End Sub