Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default password protection macro - HELP????

I have set up a workbook that protects and unprotects every sheet in the
workbook with the following macros: (My problem is that I want to allow the
user to enter comments into the protected worksheets and I can't figure out
how to get the protection macro to allow this.) I know it has something to do
with "drawingobjects=false", but I can't squeeze it in.--------Please Help:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="****"
Next ws
'
End Sub


Sub Unprotect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="****"
Next ws
'
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default password protection macro - HELP????

The cell will need to be unlocked or if its a certain column just unlock that
column.

"Teddy-B" wrote:

I have set up a workbook that protects and unprotects every sheet in the
workbook with the following macros: (My problem is that I want to allow the
user to enter comments into the protected worksheets and I can't figure out
how to get the protection macro to allow this.) I know it has something to do
with "drawingobjects=false", but I can't squeeze it in.--------Please Help:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="****"
Next ws
'
End Sub


Sub Unprotect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="****"
Next ws
'
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default password protection macro - HELP????

Doeas anyone else have an idea on how to get this step into the macro so that
I won't have to manually do it?

"Mike" wrote:

The cell will need to be unlocked or if its a certain column just unlock that
column.

"Teddy-B" wrote:

I have set up a workbook that protects and unprotects every sheet in the
workbook with the following macros: (My problem is that I want to allow the
user to enter comments into the protected worksheets and I can't figure out
how to get the protection macro to allow this.) I know it has something to do
with "drawingobjects=false", but I can't squeeze it in.--------Please Help:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="****"
Next ws
'
End Sub


Sub Unprotect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="****"
Next ws
'
End Sub

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default password protection macro - HELP????

Try this

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Protect Password:="justme", DrawingObjects:=False, _
Contents:=True, Scenarios:=True
'choose enableselection mode
' .EnableSelection = xlUnlockedCells
' .EnableSelection = xlNoRestrictions
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Thu, 9 Oct 2008 08:44:04 -0700, Teddy-B
wrote:

I have set up a workbook that protects and unprotects every sheet in the
workbook with the following macros: (My problem is that I want to allow the
user to enter comments into the protected worksheets and I can't figure out
how to get the protection macro to allow this.) I know it has something to do
with "drawingobjects=false", but I can't squeeze it in.--------Please Help:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="****"
Next ws
'
End Sub


Sub Unprotect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="****"
Next ws
'
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 76
Default password protection macro - HELP????

Thanks "Gord" - You are the master! I would encourage evryone to macrotize
their spreadsheet(s) protection in multiple spreadsheet workbooks. It would
be cool if this were a built-in function for those of us who administer large
multi-sheet workwooks for the general staff - but the password would have to
be visible only as ******* in the macro :-)

'CHEERS'

"Gord Dibben" wrote:

Try this

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Protect Password:="justme", DrawingObjects:=False, _
Contents:=True, Scenarios:=True
'choose enableselection mode
' .EnableSelection = xlUnlockedCells
' .EnableSelection = xlNoRestrictions
End With
Next ws
End Sub


Gord Dibben MS Excel MVP

On Thu, 9 Oct 2008 08:44:04 -0700, Teddy-B
wrote:

I have set up a workbook that protects and unprotects every sheet in the
workbook with the following macros: (My problem is that I want to allow the
user to enter comments into the protected worksheets and I can't figure out
how to get the protection macro to allow this.) I know it has something to do
with "drawingobjects=false", but I can't squeeze it in.--------Please Help:

Sub protect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect Password:="****"
Next ws
'
End Sub


Sub Unprotect_sheets()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Unprotect Password:="****"
Next ws
'
End Sub





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
Clear Macro & Password Protection Mike Excel Discussion (Misc queries) 1 April 1st 08 01:14 AM
use a macro to automate excel worksheet password protection Bodyshopman Excel Discussion (Misc queries) 2 July 25th 07 01:21 AM
develop a macro which takes password protection on and off Gai Excel Discussion (Misc queries) 4 November 16th 06 06:14 AM
Password protection Tia Excel Discussion (Misc queries) 2 May 1st 06 08:37 PM
Password Protection carter Excel Discussion (Misc queries) 1 February 22nd 05 09:27 PM


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