#1   Report Post  
Posted to microsoft.public.excel.misc
TheRook
 
Posts: n/a
Default Passowrd Protecting

I currently have 8 sheets within a workbook which are protected, on each
sheet I have some locked and unlocked cells. Each worksheet is for each day
of the week plus a totals sheet, therefore the layout for each sheet is
identical. At present If I need to make an amendment to any of the locked
cells I have to unprotect every sheet make the change and then proect every
sheet.

Is there anyway of proecting ALL the sheets at once and unprotecting them
all at once as this would reduce the time it takes.

Regards
The Rook
  #3   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Passowrd Protecting

You would need to use a VBA procedu


Sub ProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Protect
Next SH
End Sub

Sub UnProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Unprotect
Next SH
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"TheRook" wrote in message
...
I currently have 8 sheets within a workbook which are protected,
on each
sheet I have some locked and unlocked cells. Each worksheet is
for each day
of the week plus a totals sheet, therefore the layout for each
sheet is
identical. At present If I need to make an amendment to any of
the locked
cells I have to unprotect every sheet make the change and then
proect every
sheet.

Is there anyway of proecting ALL the sheets at once and
unprotecting them
all at once as this would reduce the time it takes.

Regards
The Rook



  #4   Report Post  
Posted to microsoft.public.excel.misc
TheRook
 
Posts: n/a
Default Passowrd Protecting

Chip,

That worked a treat, but I forgot ti include that I want to use a password.

Can this be done?

"Chip Pearson" wrote:

You would need to use a VBA procedu


Sub ProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Protect
Next SH
End Sub

Sub UnProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Unprotect
Next SH
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"TheRook" wrote in message
...
I currently have 8 sheets within a workbook which are protected,
on each
sheet I have some locked and unlocked cells. Each worksheet is
for each day
of the week plus a totals sheet, therefore the layout for each
sheet is
identical. At present If I need to make an amendment to any of
the locked
cells I have to unprotect every sheet make the change and then
proect every
sheet.

Is there anyway of proecting ALL the sheets at once and
unprotecting them
all at once as this would reduce the time it takes.

Regards
The Rook




  #5   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Passowrd Protecting

Use code like

Sub ProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Protect Password:="the_password"
Next SH
End Sub

Sub UnProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Unprotect Password:="the_password"
Next SH
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"TheRook" wrote in message
...
Chip,

That worked a treat, but I forgot ti include that I want to use
a password.

Can this be done?

"Chip Pearson" wrote:

You would need to use a VBA procedu


Sub ProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Protect
Next SH
End Sub

Sub UnProtectAll()
Dim SH As Object
For Each SH In ThisWorkbook.Sheets
SH.Unprotect
Next SH
End Sub



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"TheRook" wrote in message
...
I currently have 8 sheets within a workbook which are
protected,
on each
sheet I have some locked and unlocked cells. Each worksheet
is
for each day
of the week plus a totals sheet, therefore the layout for
each
sheet is
identical. At present If I need to make an amendment to any
of
the locked
cells I have to unprotect every sheet make the change and
then
proect every
sheet.

Is there anyway of proecting ALL the sheets at once and
unprotecting them
all at once as this would reduce the time it takes.

Regards
The Rook






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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protecting more than one worksheet in one workbook RobP Excel Discussion (Misc queries) 1 April 18th 06 06:19 PM
Locking Cells ... Without Protecting Sheet monir Excel Discussion (Misc queries) 0 April 4th 06 06:17 AM
Locking Cells ... Without Protecting Sheet monir Excel Discussion (Misc queries) 0 April 4th 06 06:15 AM
Protecting Sheets albertmb Excel Discussion (Misc queries) 7 March 13th 06 09:13 PM
Leave list box unprotected while protecting worksheet acukid Excel Discussion (Misc queries) 1 September 13th 05 06:48 PM


All times are GMT +1. The time now is 12:16 PM.

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

About Us

"It's about Microsoft Excel"