So here's the deal:
I have 10-15 comboboxes on one sheet where you can select various items from them. The selections from the comboboxes are then placed in cells in other worksheets of the same workbook. There is an option to select nothing from the combobox (ie blank line). If the blank line is selected then the row in the other worksheets where the selection is placed is then hidden.
This works all well and good until I protect each sheet. I have to have the cells where the combobox selctions end up protected because I want the user to be only able to select one of my choices.
I thought that I'd write a sub that I could call at the beginning of the combobox change sub that would just unprotect all the sheets and then another that would protect them when the sub was finished.
Sub Unprotect()
For Each ws in Worksheets
ws.Unprotect
Next ws
End Sub
Sub Protect()
For Each ws in Worksheets
ws.Protect
Next ws
End Sub
This subs work well as stand alone subs but when I try to call them at the beginning or end of the combobox change sub they get an error.
I'd appreciate any help that anyone could give. Or if someone knew a better way to go about this, that would be great too. Thanks in advance.
I have 10-15 comboboxes on one sheet where you can select various items from them. The selections from the comboboxes are then placed in cells in other worksheets of the same workbook. There is an option to select nothing from the combobox (ie blank line). If the blank line is selected then the row in the other worksheets where the selection is placed is then hidden.
This works all well and good until I protect each sheet. I have to have the cells where the combobox selctions end up protected because I want the user to be only able to select one of my choices.
I thought that I'd write a sub that I could call at the beginning of the combobox change sub that would just unprotect all the sheets and then another that would protect them when the sub was finished.
Sub Unprotect()
For Each ws in Worksheets
ws.Unprotect
Next ws
End Sub
Sub Protect()
For Each ws in Worksheets
ws.Protect
Next ws
End Sub
This subs work well as stand alone subs but when I try to call them at the beginning or end of the combobox change sub they get an error.
I'd appreciate any help that anyone could give. Or if someone knew a better way to go about this, that would be great too. Thanks in advance.