ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do I protect a worksheet and still use a checkbox control (https://www.excelbanter.com/excel-worksheet-functions/41311-how-do-i-protect-worksheet-still-use-checkbox-control.html)

JayS

how do I protect a worksheet and still use a checkbox control
 
My checkbox function works like this:

When checked, it unhides certain cells, when unchecked, it hides the same
said cells. When I use the protect worksheet function and I click on the
check-box, I get a message saying €śThe cell or chart you are trying to change
is protected and therefore read-only€ť. How can I use the protect worksheet
function and get the check-box function to work?


Casey


Jay,
You need an Unprotect / Protect routine in your checkbox procedure.
Something like:

Private Sub CheckBox1_Click()
ActiveSheet.Unprotect ("password")

"YOUR CODE HERE"

ActiveSheet.Protect ("password")
End Sub

HTH


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=397242


sneakyzeal


Hi.. I need to do this exact same thing (protect a sheet but still have
3 option buttons functioning, which change certain cells in the
worksheet). I've tried the code you suggested but it doesn't seem to
work properly. Also, I don't need to password protect.

Any other ideas?


--
sneakyzeal
------------------------------------------------------------------------
sneakyzeal's Profile: http://www.excelforum.com/member.php...o&userid=26978
View this thread: http://www.excelforum.com/showthread...hreadid=397242


Casey


SneakyZeal,
Post the code for your option buttons and I will try to help. I'm
really buried today so it may be towards mid afternoon before I can get
back to you.


--
Casey


------------------------------------------------------------------------
Casey's Profile: http://www.excelforum.com/member.php...fo&userid=4545
View this thread: http://www.excelforum.com/showthread...hreadid=397242


sneakyzeal


Hi Casey, I only just saw your reply. I managed to work it out all by
myself! But thanks anyway :)

Sneaky


--
sneakyzeal
------------------------------------------------------------------------
sneakyzeal's Profile: http://www.excelforum.com/member.php...o&userid=26978
View this thread: http://www.excelforum.com/showthread...hreadid=397242



All times are GMT +1. The time now is 01:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com