Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Pass word protecting multipul worksheets within a workbook

is there a way to pass word protect multiful worksheets within a workbook at
the same time.

i have several workbooks that have 5-35 worksheets that all need pass word
protected and would like to do it all at the same time.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default Pass word protecting multipul worksheets within a workbook

This will do it

Sub Macro1()
Dim strPassword As String
Dim mySheet As Worksheet
For Each mySheet In Worksheets
strPassword = InputBox("Enter the password for the worksheet")
mySheet.Protect Password:=strPassword, Scenarios:=True
Next
End Sub

If you wish to use a single password
Sub Macro1()
Dim strPassword As String
Dim mySheet As Worksheet
strPassword = InputBox("Enter the password for the worksheet")
For Each mySheet In Worksheets
mySheet.Protect Password:=strPassword, Scenarios:=True
Next
End Sub

Need hep with VBA? David McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Happy New Year
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Terrie" wrote in message
...
is there a way to pass word protect multiful worksheets within a workbook
at
the same time.

i have several workbooks that have 5-35 worksheets that all need pass word
protected and would like to do it all at the same time.



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
multiple worksheets in workbook mail merged into a word documents la Excel Worksheet Functions 1 August 8th 07 05:52 PM
protecting worksheets David Harrison Excel Discussion (Misc queries) 3 December 17th 06 09:28 PM
Protecting all worksheets of a workbook neeraj Excel Discussion (Misc queries) 14 May 30th 06 09:46 PM
Forgot my pass word for excel sheet Suresh Excel Worksheet Functions 1 April 4th 06 01:50 PM
How do I my find pass word in excel AlShepard Setting up and Configuration of Excel 0 February 6th 06 09:32 PM


All times are GMT +1. The time now is 05:49 PM.

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"