Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Newsgal
 
Posts: n/a
Default Protect/unprotect ALL worksheets in workbook ?


-- Is it possible to protect/unprotect all worksheets in a workbook at once
instead of having to do each individually if the password is the same?

News Gal
  #2   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson
 
Posts: n/a
Default Protect/unprotect ALL worksheets in workbook ?

The only way to do that is with some VBA code:

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


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


"Newsgal" wrote in message
...

-- Is it possible to protect/unprotect all worksheets in a
workbook at once
instead of having to do each individually if the password is
the same?

News Gal



  #3   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default Protect/unprotect ALL worksheets in workbook ?

The only way is to use a macro to do this

Sub test()
Dim sh As Worksheet
For Each sh In ThisWorkbook.Worksheets
sh.Unprotect "ron"
Next sh
End Sub

Or
sh.Protect "ron"



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Newsgal" wrote in message ...

-- Is it possible to protect/unprotect all worksheets in a workbook at once
instead of having to do each individually if the password is the same?

News Gal



  #4   Report Post  
Posted to microsoft.public.excel.misc
Kevin B
 
Posts: n/a
Default Protect/unprotect ALL worksheets in workbook ?

This macro would do the trick

Sub Unprotect()

Dim wb As Workbook
Dim ws As Worksheet
Dim blnIsProtected As Boolean
Set wb = ActiveWorkbook

For Each ws In wb.Worksheets
ws.Unprotect "test"
Next ws

Set wb = Nothing
Set ws = Nothing

End Sub

--
Kevin Backmann


"Newsgal" wrote:


-- Is it possible to protect/unprotect all worksheets in a workbook at once
instead of having to do each individually if the password is the same?

News Gal

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Protect/unprotect ALL worksheets in workbook ?

I need to know how to protect the entire worksheet (all tabs within it) with
a click of a button; not sure what the last solution entails. Please help.

ers




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Protect/unprotect ALL worksheets in workbook ?

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 MS Excel MVP

On Tue, 4 May 2010 10:11:01 -0700, ers18
wrote:

I need to know how to protect the entire worksheet (all tabs within it) with
a click of a button; not sure what the last solution entails. Please help.

ers


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 all worksheets of a workbook neeraj Excel Discussion (Misc queries) 14 May 30th 06 09:46 PM
Protect Workbook vs Worksheet?? Dan B Excel Worksheet Functions 3 November 7th 05 09:02 PM
Appending external worksheets into existing workbook? Xuratoth Links and Linking in Excel 5 October 4th 05 12:48 PM
How do I build a workbook from the worksheets another workbook? Rico Excel Discussion (Misc queries) 4 August 19th 05 02:04 PM
how do i link a list of items in a workbook to worksheets in the . Camalla Excel Discussion (Misc queries) 2 April 22nd 05 09:35 PM


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