ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do i protect multiple worksheets (https://www.excelbanter.com/excel-discussion-misc-queries/53046-how-do-i-protect-multiple-worksheets.html)

Dennis

how do i protect multiple worksheets
 
I have a workbook with 30 sheets where I would like to protect all the sheets
at one time. I have followerd directions already posted and must be doing
something wrong because I cannot protect all sheets. I guess I need vsome
very basic help because I cannot make the codes work properly. I have entered
as posted several times so I must be missing a step.

dominicb

how do i protect multiple worksheets
 

Good evening Dennis

If you don't want to get involved with VBA, I have a free add-in
available to anyone requesting it that will (amongst other tasks)
protect as many sheets as is necessary - with or without a password -
at once. The same sheets can also be unprotected all at once also.

If you want to use this feel free to send me an e-mail.

HTH

DominicB



--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=480731


Gord Dibben

how do i protect multiple worksheets
 
Dennis

Don't know what you have tried so can't speak to that.

Here are a couple of macros which you would paste into a general module in the
Visual Basic Editor.

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Protect Password:="justme"
Next n
Application.ScreenUpdating = True
End Sub

Sub UnprotectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
Sheets(n).Unprotect Password:="justme"
Next n
Application.ScreenUpdating = True
End Sub

With your workbook open.............

Hit ALT + F11 to open VBEditor.

Hit CTRL + r to open Project Explorer.

Right-click on your workbook/project and hit InsertModule

Copy and paste the code above into that module.

FileSave.

Hit ALT + q to return to Excel window.

Hit ALT + F8 to get a list of macros. The above two will be shown.

Select the ProtectAllSheets macro and "Run".

If you have a Persona Macro Workbook(Personal.xls) you may wish to have these
macros in there so's they are available for all open workbooks.

See help on "personal macros" and "create a macro".


Gord Dibben Excel MVP

On Mon, 31 Oct 2005 14:58:02 -0800, Dennis
wrote:

I have a workbook with 30 sheets where I would like to protect all the sheets
at one time. I have followerd directions already posted and must be doing
something wrong because I cannot protect all sheets. I guess I need vsome
very basic help because I cannot make the codes work properly. I have entered
as posted several times so I must be missing a step.




All times are GMT +1. The time now is 03:37 AM.

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