Is it possible to allow a user to insert cell comments on a protected worksheet?
THANKS
Is it possible to allow a user to insert cell comments on a protected worksheet?
THANKS
You'll need to create a macro to open an inputbox for the comment, unprotect the sheet, add the comment and then reprotect.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Or use the UserInterfaceOnly:=True argument and protect the workbook in the Workbook_Open event - then your code can run freely on the worksheet without having to unprotect and reprotect the sheet.
Regards,
Rory
Microsoft MVP - Excel
or for the worsheet protection you can use protect scenarios and contents only (i.e. leave 'objects' unchecked)
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Hello all, I would also like to be able to access the comment tools on a protected sheet but am unable to do so.
Rory I tried your way but it doesn't allow access to comments. I used the following:
[vba]
For Each wksh In Worksheets
wksh.Activate
Range("a1").Select
wksh.Protect password:="pword", userinterfaceonly:=True
Next wksh
[/vba]
I also tried:
[vba]
wksh.Protect password:="pword", drawingobjects:=false
[/vba]
and
[vba]
wksh.Protect password:="pword", scenarios:=false
[/vba]
But these lines unprotect everything.
Md, I didn't try your method with the input boxes. The only way I would like to use this method is to be able to add this to the menu that pops up when you right click. Is this possible?
Thanks
Gary
try
[VBA]
wksh.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
True
[/VBA]
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
Thank you Jonske that worked. It works with "userinterfaceonly:=True" in or out. Should I put it in or leave it out?
Thanks
Gary