Hello all,
I hope you are well.
I have created a drop-down menu combobox of districts and depending on your choice of districts the list of Health Centers in a specific column changes. What I want to do is to protect the contents of the column and the cells that contain the health centers. The problem is that when I lock the cells and I choose a district, the Health Center cells cannot change because the cells are locked. Is there anyway around it?
I was told to insert the following code into the sheets code:
Private Sub ComboBox1_Change()
ActiveSheet.Protect
End Sub
Private Sub ComboBox1_DropButtonClick()
ActiveSheet.Unprotect
End Sub
I went to the Developer Tab then I chose View Code then I clicked on the Sheet 2 (Sheet 1) and I pasted the code. I got a warning saying that VBA cannot work unless I save in macro-enabled sheet so I did (xlsm).
I have attached the sample (Please look at sheet 2. The column that I want to block is the column FOSA)
Thank you
Ulises
Bookmarks