#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Worksheet Protection

Good day to all

I have so many worksheet to protect. How do I protect them all together
with a single operation (no need to go to each worksheet and do the
protection).

Thank You for help

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7,247
Default Worksheet Protection

This can be done with only a VBA procedu

Sub ProtectAll()
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
WS.Protect Password:="OptionalPassword"
Next WS
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)


"faeiz2" wrote in message
ups.com...
Good day to all

I have so many worksheet to protect. How do I protect them all together
with a single operation (no need to go to each worksheet and do the
protection).

Thank You for help



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 492
Default Worksheet Protection

Press Alt and F11 together to open the VB Editor
Click 'Insert' 'Module'
In the empty window on the right, copy and paste this code,

Sub Protect()
Dim WK As Worksheet
For Each WK In ThisWorkbook.Worksheets
WK.Protect Password:="password"
Next WK
End Sub

Sub Unprotect()
Dim WK As Worksheet
For Each WK In ThisWorkbook.Worksheets
WK.Unprotect Password:="password"
Next WK
End Sub


Hit Alt and F11 to close the VB Editor

Go 'Tools' 'Macro's

'Protect' will protect all sheets, 'Unprotect' will unprotect all sheets.
Alter the password as required.

You can assign the macro's to buttons via the 'View' 'Toolbars' 'Forms'
menu,
Regards,
Alan.


"faeiz2" wrote in message
ups.com...
Good day to all

I have so many worksheet to protect. How do I protect them all together
with a single operation (no need to go to each worksheet and do the
protection).

Thank You for help



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default Worksheet Protection

Thanks a million.

Alan wrote:
Press Alt and F11 together to open the VB Editor
Click 'Insert' 'Module'
In the empty window on the right, copy and paste this code,

Sub Protect()
Dim WK As Worksheet
For Each WK In ThisWorkbook.Worksheets
WK.Protect Password:="password"
Next WK
End Sub

Sub Unprotect()
Dim WK As Worksheet
For Each WK In ThisWorkbook.Worksheets
WK.Unprotect Password:="password"
Next WK
End Sub


Hit Alt and F11 to close the VB Editor

Go 'Tools' 'Macro's

'Protect' will protect all sheets, 'Unprotect' will unprotect all sheets.
Alter the password as required.

You can assign the macro's to buttons via the 'View' 'Toolbars' 'Forms'
menu,
Regards,
Alan.


"faeiz2" wrote in message
ups.com...
Good day to all

I have so many worksheet to protect. How do I protect them all together
with a single operation (no need to go to each worksheet and do the
protection).

Thank You for help


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
Worksheet protection status JimB Excel Discussion (Misc queries) 0 September 28th 06 10:03 PM
Cell Protection vs. Worksheet Protection kmwhitt Excel Discussion (Misc queries) 4 September 24th 06 02:37 AM
Worksheet tab protection Xlim Excel Discussion (Misc queries) 2 January 16th 05 01:34 PM
copyright and worksheet protection dow Excel Discussion (Misc queries) 2 January 3rd 05 03:07 PM
Seeking help for total worksheet protection Joseph Geretz Excel Discussion (Misc queries) 10 December 31st 04 06:48 PM


All times are GMT +1. The time now is 11:05 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"