Allow specific users to edit objects "comments". Restrict all other users.

Brttcx

New Member
Joined
Nov 7, 2016
Messages
11
Good evening,
I'm struggling with this one. I have given my sheet user specific permissions to edit the range of cells. After protecting the sheet, all users are still able to edit comments. I want to restrict all users from editing comments, and allow only those who I gave "edit" permissions to rights to edit an "object".

I have tried to deselect "edit objects" when I protect the sheet, but this restricts all users from adding comments. Is there any way to do this? I'm comfortable with VBA as well, the only catch is it is a Shared Workbook, so I'm not sure what compatibility issues I might have. Thank you!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
You could try something like this
- apply different protection according to user when file is opened

For simplicity of illustration sheet protection paramaters limited - amend to suit your needs
(record a macro when you set protect paramaters and use that to guide you)


Code:
[I][COLOR=#000080]Workbook_Open must be placed in ThisWorkbook module[/COLOR][/I]
Private Sub Workbook_Open()
    Call WhichUser
End Sub

Sub WhichUser()
    Dim usr As Variant
    With Sheets("Sheet1")
        .Unprotect "password"
            For Each usr In Array("yongle", "john", "peter")
                If Application.UserName = usr Then
                    .Protect "password", DrawingObjects:=False, Contents:=True, Scenarios:=True
                Else
                    .Protect "password", DrawingObjects:=True, Contents:=True, Scenarios:=True
                End If
            Next
    End With
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,157
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top