A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Protecting all worksheets of a workbook



 
 
Thread Tools Display Modes
  #1  
Old September 19th, 2005, 10:51 PM
neeraj
external usenet poster
 
Posts: n/a
Default Protecting all worksheets of a workbook

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.
  #2  
Old September 19th, 2005, 11:09 PM
bigwheel
external usenet poster
 
Posts: n/a
Default

To protect your worksheets:-

Dim mySheet As Worksheet
For Each mySheet In Worksheets
mySheet.Protect Password:= password1
Next mySheet

"neeraj" wrote:

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.

  #3  
Old September 19th, 2005, 11:10 PM
Anne Troy
external usenet poster
 
Posts: n/a
Default

Try this:
http://vbaexpress.com/kb/getarticle.php?kb_id=142
************
Anne Troy
www.OfficeArticles.com

"neeraj" wrote in message
...
I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar
in
layout and format except data. I was able to select all sheets and 'lock'
and
'hide' desired cells in each in one stroke. But locking and hiding of
cells
dont come into effect till I protect each sheet. I want to password
protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few
employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the
entire
workbook, the menu inside doesn't seem to lead in the direction that I
want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.



  #4  
Old September 19th, 2005, 11:16 PM
neeraj
external usenet poster
 
Posts: n/a
Default

This seems to be a VB code. I am new to VB. Where do I write it in my workbook

"bigwheel" wrote:

To protect your worksheets:-

Dim mySheet As Worksheet
For Each mySheet In Worksheets
mySheet.Protect Password:= password1
Next mySheet

"neeraj" wrote:

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.

  #5  
Old September 19th, 2005, 11:39 PM
bigwheel
external usenet poster
 
Posts: n/a
Default

Press Alt+F11 then click InsertModule. Enter the line

Sub ProtectSheets() and copy the code to the next line. An End Sub
statement should be added automatically

"neeraj" wrote:

This seems to be a VB code. I am new to VB. Where do I write it in my workbook


  #6  
Old September 20th, 2005, 04:46 AM
Larry
external usenet poster
 
Posts: n/a
Default

I protect multiple sheets all at one time using a free utility that you can
download and install as an add-in. All sheets will have the same password.

http://www.asap-utilities.com/

"neeraj" wrote:

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.

  #7  
Old September 20th, 2005, 04:41 PM
neeraj
external usenet poster
 
Posts: n/a
Default

Thanks, I downloaded the utilitity, it worked but I still have to go about
clearing the 'select locked cells' in each individual sheet if I did not want
my users to be able to select locked cells

"Anne Troy" wrote:

Try this:
http://vbaexpress.com/kb/getarticle.php?kb_id=142
************
Anne Troy
www.OfficeArticles.com

"neeraj" wrote in message
...
I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar
in
layout and format except data. I was able to select all sheets and 'lock'
and
'hide' desired cells in each in one stroke. But locking and hiding of
cells
dont come into effect till I protect each sheet. I want to password
protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few
employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the
entire
workbook, the menu inside doesn't seem to lead in the direction that I
want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.




  #8  
Old September 20th, 2005, 05:55 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

neeraj

Try this macro.

Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim n As Single
For n = 1 To Sheets.Count
With Sheets(n)
.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
.EnableSelection = xlUnlockedCells
End With
Next n
Application.ScreenUpdating = True
End Sub


Gord Dibben Excel MVP


On Tue, 20 Sep 2005 08:41:02 -0700, neeraj
wrote:

Thanks, I downloaded the utilitity, it worked but I still have to go about
clearing the 'select locked cells' in each individual sheet if I did not want
my users to be able to select locked cells

"Anne Troy" wrote:

Try this:
http://vbaexpress.com/kb/getarticle.php?kb_id=142
************
Anne Troy
www.OfficeArticles.com

"neeraj" wrote in message
...
I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar
in
layout and format except data. I was able to select all sheets and 'lock'
and
'hide' desired cells in each in one stroke. But locking and hiding of
cells
dont come into effect till I protect each sheet. I want to password
protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few
employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the
entire
workbook, the menu inside doesn't seem to lead in the direction that I
want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.





  #9  
Old September 29th, 2005, 11:12 PM
Toni
external usenet poster
 
Posts: n/a
Default

How did you lock the cells in all of your worksheets at the same time? Thanks!

"neeraj" wrote:

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.

  #10  
Old September 29th, 2005, 11:57 PM
Gord Dibben
external usenet poster
 
Posts: n/a
Default

Toni

Right-click on a sheet tab and "select all sheets".

As you select which cells to lock and unlock from the FormatCellsProtection
tab all sheets will be done at once.

To ungroup the sheets click on any other sheet tab or right-click and "ungroup
sheets".

Protection won't take place until you protect the sheets through
ToolsProtectionProtect sheet.

You cannot do this step on grouped sheets.

You will have to do them one at a time or through VBA macro.

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


Gord Dibben Excel MVP

On Thu, 29 Sep 2005 15:12:01 -0700, "Toni"
wrote:

How did you lock the cells in all of your worksheets at the same time? Thanks!

"neeraj" wrote:

I have a workbook say Book1.xls with 12 worksheets say Rep1, Rep2,
Rep3,...Rep12 for 12 different employees. These sheets are exactly similar in
layout and format except data. I was able to select all sheets and 'lock' and
'hide' desired cells in each in one stroke. But locking and hiding of cells
dont come into effect till I protect each sheet. I want to password protect
each sheet with the same password. Is there a way to password protect all
worksheets or the entire workbook in one go? The workbook Book1.xls along
with other workbooks would be shared on a network drive by a few employees. I
see there is an option:Tools-Protection-Protect and Share Workbook. Though
this option from its name sounds like it would be able to protect the entire
workbook, the menu inside doesn't seem to lead in the direction that I want
to go in. If this is not the option to do my job, what does
Tools-Protection-Protect and Share Workbook do? Thanks.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I tile worksheets within a workbook, like one tiles workbooks. Tovarish_Dad General Discussion 2 July 6th, 2005 09:11 PM
Worksheets in a workbook? Bob .-.-. New Users 4 June 23rd, 2005 10:30 PM
how do i link a list of items in a workbook to worksheets in the . Camalla General Discussion 2 April 22nd, 2005 09:35 PM
How do I sum values from different worksheets within one workbook. master gardener Worksheet Functions 1 January 28th, 2005 07:19 PM
Hyperlink to individual worksheets in same workbook kgriffith General Discussion 5 June 22nd, 2004 06:35 PM


All times are GMT +1. The time now is 07:29 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.