ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Password protecting multiple pages, and then some. (https://www.excelbanter.com/excel-discussion-misc-queries/449728-password-protecting-multiple-pages-then-some.html)

Pistolade

Password protecting multiple pages, and then some. (Solved)
 
I have several pages, and from my understanding can only do this with a macro, however I don't speak VB.
My intentions are to Lock multiple pages (with the ability to unlock if needed), however it doesn't stop there. When you protect a sheet one at a time you can select, or rather un-select, an option that allows/disallows users to select locked cells. I need this to be disallowed.
Meaning I cant have people reading the formulas behind the cells values.
Thank you
Jody

GS[_2_]

Password protecting multiple pages, and then some.
 
I have several pages, and from my understanding can only do this with
a macro, however I don't speak VB.
My intentions are to Lock multiple pages (with the ability to unlock
if needed), however it doesn't stop there. When you protect a sheet
one at a time you can select, or rather un-select, an option that
allows/disallows users to select locked cells. I need this to be
disallowed.
Meaning I cant have people reading the formulas behind the cells
values.
Thank you
Jody


If you also check the *Hidden* option on the *Protection* tab of the
*Format Cells* dialog, people will not see formulas when sheet
protection is applied.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


GS[_2_]

Password protecting multiple pages, and then some.
 
I forgot to mention you can also uncheck the *Select locked cells*
option in the *Protect sheet* dialog when setting protection.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


Pistolade

Quote:

Originally Posted by GS[_2_] (Post 1615775)
I forgot to mention you can also uncheck the *Select locked cells*
option in the *Protect sheet* dialog when setting protection.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

They need to be unhidden and I need to know a way to protect/unprotect all pages at one time since I work on some 70+ pages daily.

GS[_2_]

Password protecting multiple pages, and then some.
 
'GS[_2_ Wrote:
;1615775']I forgot to mention you can also uncheck the *Select
locked cells*
option in the *Protect sheet* dialog when setting protection.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus
protection is active.
http://www.avast.com


They need to be unhidden and I need to know a way to
protect/unprotect all pages at one time since I work on some 70+
pages daily.


But you stated you did not want peaople to see the formulas!! When the
sheet is protected the formulas are not viewable but their results are
viewable because the cell remains visible.

Also, you need to apply protection to each sheet individually. This
requires looping through the Worksheets collection. There are a couple
ways to go with this:

1. Write a macro to protect all sheets when manually executed. Perhaps
something like...

Sub SetProtection()
Dim Wks As Worksheet
For Each Wks In ActiveWorkbook.Worksheets
Wks.Protect Password:="pwd"
Next
End Sub

...which doesn't require this macro be in the workbook being protected.

2. Have this done automatically via ThisWorkbook.Sheet_Activate event
whenever a worksheet is activated. (This requires macros be allowed
because the code must reside in the workbook)

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Sh.Protect Password:="pwd"
End Sub

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


Pistolade

Quote:

Originally Posted by GS[_2_] (Post 1615802)
'GS[_2_ Wrote:
;1615775']I forgot to mention you can also uncheck the *Select
locked cells*
option in the *Protect sheet* dialog when setting protection.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus
protection is active.
http://www.avast.com


They need to be unhidden and I need to know a way to
protect/unprotect all pages at one time since I work on some 70+
pages daily.


But you stated you did not want peaople to see the formulas!! When the
sheet is protected the formulas are not viewable but their results are
viewable because the cell remains visible.

Also, you need to apply protection to each sheet individually. This
requires looping through the Worksheets collection. There are a couple
ways to go with this:

1. Write a macro to protect all sheets when manually executed. Perhaps
something like...

Sub SetProtection()
Dim Wks As Worksheet
For Each Wks In ActiveWorkbook.Worksheets
Wks.Protect Password:="pwd"
Next
End Sub

...which doesn't require this macro be in the workbook being protected.

2. Have this done automatically via ThisWorkbook.Sheet_Activate event
whenever a worksheet is activated. (This requires macros be allowed
because the code must reside in the workbook)

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Sh.Protect Password:="pwd"
End Sub

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Thank you, this is closer, however; when I use the code the first few pages lock correctly. Meaning when I open them I can look, but not select. Then after the third page or so I can select them and view the formula in the formula bar but the pages are still protected. I'm not sure if this is something you have thoughts on how to fix or not, but it must be done somehow. I cant have the cells be selectable. A sort of look but don't touch type thing.
Does that give you a better understanding? I feel like I'm miscommunicating my request

GS[_2_]

Password protecting multiple pages, and then some.
 
Thank you, this is closer, however; when I use the code the first few
pages lock correctly. Meaning when I open them I can look, but not
select. Then after the third page or so I can select them and view
the
formula in the formula bar but the pages are still protected. I'm not
sure if this is something you have thoughts on how to fix or not, but
it
must be done somehow. I cant have the cells be selectable. A sort of
look but don't touch type thing.
Does that give you a better understanding? I feel like I'm
miscommunicating my request


Note that if a sheet is already protected, you must unprotect in order
make changes to the protection options.

If you uncheck the *Select locked cells* option then users can't select
any cells except those that are not locked. (Look but don't touch)

I mention checking the *Hidden* option so the formulas can't be seen if
*Select locked cells* is allowed.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


Pistolade

Quote:

Originally Posted by GS[_2_] (Post 1615993)
Thank you, this is closer, however; when I use the code the first few
pages lock correctly. Meaning when I open them I can look, but not
select. Then after the third page or so I can select them and view
the
formula in the formula bar but the pages are still protected. I'm not
sure if this is something you have thoughts on how to fix or not, but
it
must be done somehow. I cant have the cells be selectable. A sort of
look but don't touch type thing.
Does that give you a better understanding? I feel like I'm
miscommunicating my request


Note that if a sheet is already protected, you must unprotect in order
make changes to the protection options.

If you uncheck the *Select locked cells* option then users can't select
any cells except those that are not locked. (Look but don't touch)

I mention checking the *Hidden* option so the formulas can't be seen if
*Select locked cells* is allowed.

HTH

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

Thank you,
Pistolade


All times are GMT +1. The time now is 03:55 PM.

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