ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Need to password protect work sheet and unhide rows. (https://www.excelbanter.com/excel-discussion-misc-queries/160926-need-password-protect-work-sheet-unhide-rows.html)

Nicholas

Need to password protect work sheet and unhide rows.
 
I have a worksheet that I need end users to fill out. I also have a forms
check box that is active and linked to a macro, so if the user clicks on the
check box, I need to unhide additional rows for them to fill out.

However, when I turn on protection, I am getting an error. I also notice
that the hide/unhide features are greyed out.

Thanks.

JP[_3_]

Need to password protect work sheet and unhide rows.
 
Hello,
What error are you getting, and what version of Excel do you have?

I think there is one or two things you could do. Try either of these,
one should work.

1. When you protect the sheet (Tools|Protection Menu) there should be
an option to allow the user to do certain things to the workbook, i.e.
format cells, insert rows, etc

2. Add this line to your macro code:
Sheets("sheetname").UnProtect userinterfaceonly:=true

This will allow the macro to make changes to a protected sheet.


Hope this helps,
JP


On Oct 4, 5:21 pm, Nicholas
wrote:
I have a worksheet that I need end users to fill out. I also have a forms
check box that is active and linked to a macro, so if the user clicks on the
check box, I need to unhide additional rows for them to fill out.

However, when I turn on protection, I am getting an error. I also notice
that the hide/unhide features are greyed out.

Thanks.




Nicholas

Need to password protect work sheet and unhide rows.
 
Thanks for the assistance.

I wasn't able to find anything under option #1.
Option #2, I added that in, but I had to remove the : from the line.
I then added a protect line back in.

However, a couple of things.
1. I am not able to use a password to protect it. When I put a password in
and run the macro, it tells me password does not match.
2. I am not able to protect any of the cells in the rows that I want to
hide/unhide.

If you have any ideas for those that would be great.

"JP" wrote:

Hello,
What error are you getting, and what version of Excel do you have?

I think there is one or two things you could do. Try either of these,
one should work.

1. When you protect the sheet (Tools|Protection Menu) there should be
an option to allow the user to do certain things to the workbook, i.e.
format cells, insert rows, etc

2. Add this line to your macro code:
Sheets("sheetname").UnProtect userinterfaceonly:=true

This will allow the macro to make changes to a protected sheet.


Hope this helps,
JP


On Oct 4, 5:21 pm, Nicholas
wrote:
I have a worksheet that I need end users to fill out. I also have a forms
check box that is active and linked to a macro, so if the user clicks on the
check box, I need to unhide additional rows for them to fill out.

However, when I turn on protection, I am getting an error. I also notice
that the hide/unhide features are greyed out.

Thanks.






All times are GMT +1. The time now is 10:02 AM.

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