D
deelee
I'm aware I seem to be double posting but I'm desperate for help wit
this script.
My problem is the second ElseIf - it doesn't do what I think it shoul
- perhaps what I'm doing is classed an illegal?
Your help and advice is always welcome:
Case "$C$3" 'Monday
'Non-working day
If Target.Value = "No" Then
ActiveSheet.Unprotect ("MyPassword")
Range("C:C").Locked = True
Range("$C$3").Locked = False
ActiveSheet.Protect ("MyPassword")
'Working Day
ElseIf Target.Value = "Yes" Then
ActiveSheet.Unprotect ("MyPassword")
Range("$C$6:$C$10,$C$16:$C$20,$C$26:$C$30,$C$36:$
$40,$C$46:$C$50").Locked = False
ActiveSheet.Protect ("MyPassword")
'Public Holiday
ElseIf Target.Offset(1, 0) = "PH" Then
ActiveSheet.Unprotect ("MyPassword")
Range("$C$6:$C$10").Locked = True
ActiveSheet.Protect ("MyPassword")
EndIf
Thanks again
Dav
this script.
My problem is the second ElseIf - it doesn't do what I think it shoul
- perhaps what I'm doing is classed an illegal?
Your help and advice is always welcome:
Case "$C$3" 'Monday
'Non-working day
If Target.Value = "No" Then
ActiveSheet.Unprotect ("MyPassword")
Range("C:C").Locked = True
Range("$C$3").Locked = False
ActiveSheet.Protect ("MyPassword")
'Working Day
ElseIf Target.Value = "Yes" Then
ActiveSheet.Unprotect ("MyPassword")
Range("$C$6:$C$10,$C$16:$C$20,$C$26:$C$30,$C$36:$
$40,$C$46:$C$50").Locked = False
ActiveSheet.Protect ("MyPassword")
'Public Holiday
ElseIf Target.Offset(1, 0) = "PH" Then
ActiveSheet.Unprotect ("MyPassword")
Range("$C$6:$C$10").Locked = True
ActiveSheet.Protect ("MyPassword")
EndIf
Thanks again
Dav