I am using conditional formatting to gray out certain cells based on values in some other cells. But I would also like to somehow lock those grayed out cells so that no data can be entered in those cells.

As an example, I have table from a1 to d5. I am applying conditional formating in a1 to d5 range based on values in a7 to d11 range so that cells corresponding to zero values are grayed out in a1 to d5 range. Now I would also like to lock those cells in a1 to d5 range corresponding to which there were zero values in a7 to d11 range.

Is it possible? If so, would appreciate any help.

Thank you,
Jay