• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro to unprotect and reprotect sheet

gregwood

New Member
Hi All,

I would appreciate anyone assistance with the attached file.

What I'm trying to achieve is, if Yes is selected in the dropdown (Column E heading Complete) then through conditional formatting, in the corresponding row, the background fill changes, the font colour changes and the text has a strikethrough. My problem is that when the sheet is protected the conditional formatting doesn't work.

I'm looking for assistance with a macro that when Yes is selected from the dropdown, the sheet is unprotected, the conditional formatting is carried out and the sheet is protected again. This event needs to happen for each time Yes is selected in the complete column. There is no need for any changes if No is selected.

The password = password

Thanks
 

Attachments

  • Book1.xlsm
    10 KB · Views: 0
Code:
Option Explicit

Sub ProtectSheet()
    Sheet1.Protect Password:="abc"
    
End Sub

Sub UnprotectSheet()
    Sheet1.Unprotect Password:="abc"
End Sub
 

Attachments

  • Password Protect Worksheet.xlsm
    20 KB · Views: 3
Last edited:
Thank you Logit

I'm looking for the complete code that unprotects the document, carries out the conditional formatting and then reprotects the document. It needs to run when the yes is selected from the drop down.
 
Back
Top