Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Kashif Sattar
 
Posts: n/a
Default how to protect multiple worksheets simultaneouslly and not one by

I want to protect all my sheets in a workbook but it takes me very long to
apply password on individual worksheets. I have more than 180 worksheets in
my workbook. I want to make all my sheets read only/hidden formulas and
protected by password so that no body can change unless provides correct
password.

Kindly help because i really need this. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default how to protect multiple worksheets simultaneouslly and not one by

The following macro cycless through all the worksheets in the active
workbook, protecting them and assigning the password of "Password"

Sub ProtectAll()

Dim wb As Workbook
Dim ws As Worksheet

Set wb = ActiveWorkbook

For Each ws In wb.Worksheets
ws.Protect DrawingObjects:=True, _
Contents:=True, Scenarios:=True, _
Password:="Password"
Next ws

Set wb = Nothing
Set ws = Nothing

End Sub

Place it in a VBA module by pressing Alt+F11, click INSERT on the menu and
select MODULE. You can either type the code above or cut and paste it. To
run the macro select TOOLS on the menu, click MACRO and then select MACROS.
The macro will be in the list of available macros. You can select it and
then click the RUN command button.
--
Kevin Backmann


"Kashif Sattar" wrote:

I want to protect all my sheets in a workbook but it takes me very long to
apply password on individual worksheets. I have more than 180 worksheets in
my workbook. I want to make all my sheets read only/hidden formulas and
protected by password so that no body can change unless provides correct
password.

Kindly help because i really need this. Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"