Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Kim Kim is offline
external usenet poster
 
Posts: 284
Default Protecting a workbook

Hi,
I have no problem protecting a worksheet with the 'Protect Sheet' option,
but is there anyway i can protect the whole workbook the same way, without
having to select each sheet individually?
Thanks in advanced!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,071
Default Protecting a workbook

Kim
When you click on Tools - Protection, you have the option of protecting
the whole workbook. HTH Otto
"Kim" wrote in message
...
Hi,
I have no problem protecting a worksheet with the 'Protect Sheet' option,
but is there anyway i can protect the whole workbook the same way, without
having to select each sheet individually?
Thanks in advanced!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default Protecting a workbook

You may wish to note, Kim, that Protect Workbook does different things
than Protect Sheet. If you are wanting to protect many sheets at a
time, you'll need a macro.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Protecting a workbook

Hi Kim,

You can create a macro to take care of this. As part of the Macro, you will
create a Form with a Command Button. You can then add the code to the
Commnand button as follows.

Private Sub CommandButton1_Click()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
If wSheet.ProtectContents = True Then

wSheet.Unprotect Password:=TextBox1.Text
Else
wSheet.Protect Password:="replace this text with password you wish
to open sheets with"
End If
Next wSheet
Unload Me
End Sub
--
tech1NJ


"Kim" wrote:

Hi,
I have no problem protecting a worksheet with the 'Protect Sheet' option,
but is there anyway i can protect the whole workbook the same way, without
having to select each sheet individually?
Thanks in advanced!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Protecting a 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

Unprotect all sheets....................

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

Protect selected sheets..........................

Sub Protect_Selected_Sheets()
Application.ScreenUpdating = False
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.Protect Password:="justme"
Next ws
Application.ScreenUpdating = True
End Sub

Unprotect selected sheets................

Sub UnProtect_Selected_Sheets()
Application.ScreenUpdating = False
Set MySheets = ActiveWindow.SelectedSheets
For Each ws In MySheets
ws.Select
ws.UnProtect Password:="justme"
Next ws
Application.ScreenUpdating = True
End Sub


Gord Dibben MS Excel MVP

On Thu, 25 Sep 2008 16:39:01 -0700, Kim
wrote:

Hi,
I have no problem protecting a worksheet with the 'Protect Sheet' option,
but is there anyway i can protect the whole workbook the same way, without
having to select each sheet individually?
Thanks in advanced!




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 58
Default Protecting a workbook

Hi Kim,

Did you find my post useful? Please let me know. I like to make sure that
you got what you needed. If so, please let me know by indicating so on the
reply or the post itself. Thanks
--
tech1NJ


"Kim" wrote:

Hi,
I have no problem protecting a worksheet with the 'Protect Sheet' option,
but is there anyway i can protect the whole workbook the same way, without
having to select each sheet individually?
Thanks in advanced!

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 workbook jolowe Excel Discussion (Misc queries) 2 June 8th 08 02:57 PM
Protecting a workbook Sasikiran Excel Discussion (Misc queries) 1 March 6th 08 10:05 PM
Protecting a workbook Oldjay Excel Discussion (Misc queries) 1 February 24th 08 08:40 PM
Protecting Workbook!.. Neo1 Excel Worksheet Functions 3 May 3rd 06 01:22 PM
Protecting Workbook Paul Cooling Excel Discussion (Misc queries) 2 March 7th 05 11:55 AM


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

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"