Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
GuyB
 
Posts: n/a
Default Multiple protections


Hi , is it possible to lock and unlock with protection passwords (all
using same password) multiple sheets, in a workbook by using just one
command or do they have to be all done individually?

Guy B


--
GuyB
------------------------------------------------------------------------
GuyB's Profile: http://www.excelforum.com/member.php...o&userid=27994
View this thread: http://www.excelforum.com/showthread...hreadid=474983

  #2   Report Post  
Paul Sheppard
 
Posts: n/a
Default


GuyB Wrote:
Hi , is it possible to lock and unlock with protection passwords (all
using same password) multiple sheets, in a workbook by using just one
command or do they have to be all done individually?

Guy B


Hi GuyB

You will need a macro to do this, see details below.

If you want this just for 1 workbook put the macro into the Visual
Basic Editor for that sheet, if you want it available for all workbooks
you will need to put it into the visual basic editor for Personal.xls

Public Sub Unprotect_All()
Dim wks As Worksheet
Dim vPword As Variant
On Error Resume Next
For Each wks In ActiveWorkbook.Worksheets
With wks
.Unprotect vPword
Do While .ProtectContents
vPword = Application.InputBox( _
prompt:="Enter password for " & .Name, _
Title:="Unprotect sheets", _
Default:="", _
Type:=2)
If vPword = False Then Exit Sub 'user cancelled
.Unprotect vPword
Loop
End With
Next
End Sub

Public Sub Protect_All()
Dim wks As Worksheet
Dim vPword As Variant
vPword = Application.InputBox( _
prompt:="Enter Password: ", _
Title:="Protect sheets", _
Default:="", _
Type:=2)
If vPword = False Then Exit Sub 'user cancelled
For Each wks In ActiveWorkbook.Worksheets
wks.Protect vPword
Next
End Sub


--
Paul Sheppard


------------------------------------------------------------------------
Paul Sheppard's Profile: http://www.excelforum.com/member.php...o&userid=24783
View this thread: http://www.excelforum.com/showthread...hreadid=474983

  #3   Report Post  
GuyB
 
Posts: n/a
Default


Hey Paul, thnak you for your assistance.
I am creating reports for a school and hope that this may save me
time.
Cheers
Guy B


--
GuyB
------------------------------------------------------------------------
GuyB's Profile: http://www.excelforum.com/member.php...o&userid=27994
View this thread: http://www.excelforum.com/showthread...hreadid=474983

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
view multiple files in multiple windows on multiple screens. tcom Excel Discussion (Misc queries) 7 September 15th 05 09:35 PM
How do i auto create multiple files from 1 with multiple sheets Kathy Excel Worksheet Functions 0 July 26th 05 01:23 AM
Adding multiple worksheets Craig Excel Worksheet Functions 1 July 6th 05 07:21 PM
Can I get the mode, min, and max with multiple criteria? BobT Excel Discussion (Misc queries) 1 February 15th 05 03:20 AM
XML / parent with multiple children and with multiple children Richard Excel Discussion (Misc queries) 0 January 5th 05 11:49 AM


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