View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
Prashanth KR Prashanth KR is offline
external usenet poster
 
Posts: 25
Default How do I protect a number of sheets allowing the user to add a


Hello Gary,

It was really very helpful. Thanks again. Hope to be in touch with you.

My appreciations for the immediate response.

Prashanth KR.


"Gary''s Student" wrote:

For a SINGLE sheet that is unProtected:

Sub Macro1()
With ActiveSheet
.Protect DrawingObjects:=False, Contents:=True, Scenarios:=True
.EnableSelection = xlUnlockedCells
End With
End Sub

will:
1. Protect the sheet
2. allow unlocked cells to receive comments
3. not allow locked cells to receive comments

Insert in a loop
--
Gary''s Student - gsnu200738


"Prashanth KR" wrote:

Hi,

How do I protect a workbook having a number of sheets (around 50) allowing
the user to add a comment. I tried this with the following macro:

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

But it would not allow me to add a "Comment" in the unprotected cells.
Kindly help me to create a macro so that I can protect all sheets at one shot
and also allow users to add comments in the unprotected cells.

Please also note that Iam very new to VBA.

Your help is much appreciated,
Prashanth KR