L
lgbjr
Hi All,
Is there a sheet protection scheme in Excel that allows me to set a cells
locked property to true, and protect the sheet, but still be able to change
the value of the cell from VBA?
As an example, I have a Combobox on a sheet. The combo box has 2 columns, 1
of which is shown in the dropdown. the second column value is displayed in a
cell using:
MySheet.Cells(2,2) = ComboBox.Column(2)
However, I don't want the user arbitrarily typing in cell B2 because this
value drives other formulas on the sheet. So, I lock the cell and protect
the sheet. But, then when I try to change the cells value from VBA (as
above), I can't.
Seems that there should be a way to do this without using unprotect /
protect in the VBA code everytime I want to change a locked cell's value. I
don't like the idea of having the sheet protection password pasted all over
the VBA code.
TIA
Lee
Is there a sheet protection scheme in Excel that allows me to set a cells
locked property to true, and protect the sheet, but still be able to change
the value of the cell from VBA?
As an example, I have a Combobox on a sheet. The combo box has 2 columns, 1
of which is shown in the dropdown. the second column value is displayed in a
cell using:
MySheet.Cells(2,2) = ComboBox.Column(2)
However, I don't want the user arbitrarily typing in cell B2 because this
value drives other formulas on the sheet. So, I lock the cell and protect
the sheet. But, then when I try to change the cells value from VBA (as
above), I can't.
Seems that there should be a way to do this without using unprotect /
protect in the VBA code everytime I want to change a locked cell's value. I
don't like the idea of having the sheet protection password pasted all over
the VBA code.
TIA
Lee