Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 202
Default How do I lock several sheets

I have a spredsheet with 100 identical sheets, and I like to lock/protect all
the sheets. Is it possible to do this in a simple way instead of that I have
to lock each of them.
--
Jane
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,393
Default How do I lock several sheets

This pair of subroutines with protect/Unprotect all the worksheets in the
current book. Unfamiliar with VBA? It really can be fun. See David
McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sub LockDown()
For Each ws In Worksheets
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Next
End Sub

Sub UnlockAll()
For Each ws In Worksheets
ws.Unprotect
Next
End Sub

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

"Jane" wrote in message
...
I have a spredsheet with 100 identical sheets, and I like to lock/protect
all
the sheets. Is it possible to do this in a simple way instead of that I
have
to lock each of them.
--
Jane



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 202
Default How do I lock several sheets

You're right: It can be fun - especially when it works!!
--
Jane


"Bernard Liengme" skrev:

This pair of subroutines with protect/Unprotect all the worksheets in the
current book. Unfamiliar with VBA? It really can be fun. See David
McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sub LockDown()
For Each ws In Worksheets
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Next
End Sub

Sub UnlockAll()
For Each ws In Worksheets
ws.Unprotect
Next
End Sub

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

"Jane" wrote in message
...
I have a spredsheet with 100 identical sheets, and I like to lock/protect
all
the sheets. Is it possible to do this in a simple way instead of that I
have
to lock each of them.
--
Jane




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 202
Default How do I lock several sheets

An additional question: How do I make sure, that the protection can't be
removed by the user og my spredsheet? I would like to incorporate a code in
my protection.
--
Jane


"Bernard Liengme" skrev:

This pair of subroutines with protect/Unprotect all the worksheets in the
current book. Unfamiliar with VBA? It really can be fun. See David
McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sub LockDown()
For Each ws In Worksheets
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Next
End Sub

Sub UnlockAll()
For Each ws In Worksheets
ws.Unprotect
Next
End Sub

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

"Jane" wrote in message
...
I have a spredsheet with 100 identical sheets, and I like to lock/protect
all
the sheets. Is it possible to do this in a simple way instead of that I
have
to lock each of them.
--
Jane




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I lock several sheets

That's the bad news with excel. Worksheet protection is pretty easily broken.
If the user is dedicated, they'll find these newsgroups and get an answer in
moments.

But you can make it a little tougher by protecting your code:

Open your workbook
Open the VBE (alt-f11)
select your poject
Tools|VBAProject Properties|Protection tab
Give it a memorable password.

Save your workbook, close it and reopen it to test that protection.

Be aware that this password can be broken or avoided, too. So it's not
foolproof.

Jane wrote:

An additional question: How do I make sure, that the protection can't be
removed by the user og my spredsheet? I would like to incorporate a code in
my protection.
--
Jane

"Bernard Liengme" skrev:

This pair of subroutines with protect/Unprotect all the worksheets in the
current book. Unfamiliar with VBA? It really can be fun. See David
McRitchie's site on "getting started" with VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Sub LockDown()
For Each ws In Worksheets
ws.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Next
End Sub

Sub UnlockAll()
For Each ws In Worksheets
ws.Unprotect
Next
End Sub

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

"Jane" wrote in message
...
I have a spredsheet with 100 identical sheets, and I like to lock/protect
all
the sheets. Is it possible to do this in a simple way instead of that I
have
to lock each of them.
--
Jane





--

Dave Peterson
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
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 1 January 21st 07 09:44 AM
Multiple Sheets (Need to create 500 individual sheets in one workbook, pulling DATA Amaxwell Excel Worksheet Functions 4 August 17th 06 06:23 AM
How to repeat a code for selected sheets (or a contiguous range of sheets) in a Workbook? Dmitry Excel Worksheet Functions 6 March 29th 06 12:43 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM


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