S
sam
Here is sample code:
If Worksheets("Sheet1").Range("E5").Value = "1" Then
Worksheets("Sheet1").Protect
Else
If Worksheets("Sheet1").Range("E5").Value = "2" Then
Worksheets("Sheet1").Unprotect
Worksheets("Sheet1").Range("J8").Value = "111"
End If
End If
When I choose the value 2 in the dropdown list of range E5, it can
unprotect this worksheet. But, it doesn't execute the clause after
unprotect. However, after I click anything on this worksheet, the
clause after unprotect runs(111 appears on the range J8). I am confused
about this. Do you know how to fix this problem?Thank you!
Best Regards
Sam
If Worksheets("Sheet1").Range("E5").Value = "1" Then
Worksheets("Sheet1").Protect
Else
If Worksheets("Sheet1").Range("E5").Value = "2" Then
Worksheets("Sheet1").Unprotect
Worksheets("Sheet1").Range("J8").Value = "111"
End If
End If
When I choose the value 2 in the dropdown list of range E5, it can
unprotect this worksheet. But, it doesn't execute the clause after
unprotect. However, after I click anything on this worksheet, the
clause after unprotect runs(111 appears on the range J8). I am confused
about this. Do you know how to fix this problem?Thank you!
Best Regards
Sam