ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protection worksheet (https://www.excelbanter.com/excel-programming/427602-protection-worksheet.html)

Hamed parhizkar

Protection worksheet
 
I grouped several lines together, such as line 100-150, so I can click on the
+ and - to unhide then hide the cells. I also created a command button that
unhides the lines and hides them. Everything works perfect but when I try to
protect the sheet so the formulas dont get messed up.... if you click the
button I keep getting a debug error 1004. Is there no way to protect a sheet
and still have a functional command button?

Heera[_2_]

Protection worksheet
 

use this code.
ActiveSheet.Unprotect Password:="pass123"

Hamed parhizkar

Protection worksheet
 
Where would I put that, under the script for the command button? If so, I did
then when I protected the sheet I still got a debug error 1004. Do you have
an email address so you can look at it?

"Heera" wrote:


use this code.
ActiveSheet.Unprotect Password:="pass123"


Heera[_2_]

Protection worksheet
 



All times are GMT +1. The time now is 11:04 AM.

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