• 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.

Protect cells if contain conditional formatting color

navic

Active Member
Is it possible to protect (lock) specific range cells that contain color highlighted by Conditional Formatting.
These cells are variable.

It works from the dates in the calendar month.
When the year changes, the marked dates (weekends) also change automatically.
I want all cells belonging to the weekend and holiday dates to be locked automatically.
Please see attached example.

Is there any VBA code to solve this problem (or another way)?
 

Attachments

  • autolockcells.xlsx
    13 KB · Views: 3
HI,Just you can make it without Vba Code ,
put this in Data Validation
Code:
=AND(WEEKDAY(C$4,2)<6,C$5<>$AL$2:$AL$13)
 

Attachments

  • autolockcells1.xlsx
    13.4 KB · Views: 5
Last edited:
Back
Top