+ Reply to Thread
Results 1 to 3 of 3

Insert comment in protected worksheet

  1. #1
    The Tuner
    Guest

    Insert comment in protected worksheet

    What are the correct settings that will allow a user to insert a cell comment
    in an unprotected cell of a protected worksheet? When the worksheet is
    protected, the insert comment function is not available (greyed out).

  2. #2
    Jason Morin
    Guest

    RE: Insert comment in protected worksheet

    You could have the user run this macro. The major drawback is that if a user
    wishes to edit an existing comment, they can't. They'd have to insert a new
    comment over the old one:

    Sub InsertComment()
    Dim strPassword As String
    Dim strCommText As String
    Dim strMsg As String
    Dim strMsg2 As String
    Dim nMsgResp As Long
    Dim strOldComm As String

    strPassword = "apple" 'change to your password
    strMsg = "Comment already in cell! Do you want to insert a new comment?"
    strMsg2 = "Insert text for comment in "

    With ActiveCell
    If Not .Comment Is Nothing Then
    strOldComm = .Comment.Text
    nMsgResp = MsgBox(strMsg, vbYesNo)
    If nMsgResp = vbYes Then
    .Comment.Delete
    GoTo NewComment
    Else
    Exit Sub
    End If
    Else
    NewComment:
    strCommText = InputBox(strMsg2 & .Address(False, False) & ":")
    ActiveSheet.Unprotect Password:=strPassword
    .AddComment
    If strCommText = "" Then
    .Comment.Text Text:=strOldComm
    Else
    .Comment.Text Text:=strCommText
    ActiveSheet.Protect Password:=strPassword
    End If
    End If
    End With

    End Sub

    ---
    HTH
    Jason
    Atlanta, GA


    "The Tuner" wrote:

    > What are the correct settings that will allow a user to insert a cell comment
    > in an unprotected cell of a protected worksheet? When the worksheet is
    > protected, the insert comment function is not available (greyed out).


  3. #3
    Dave Peterson
    Guest

    Re: Insert comment in protected worksheet

    If you allow the users to "Edit objects"

    In xl2002+
    Tools|protect|protect sheet
    there's a list of things that you want to allow the users to do.

    If you check "edit objects", then they can insert comments (and do other things
    to other objects--pictures, buttons...)

    In xl2k and before, I think there's an checkbox on that dialog.

    The Tuner wrote:
    >
    > What are the correct settings that will allow a user to insert a cell comment
    > in an unprotected cell of a protected worksheet? When the worksheet is
    > protected, the insert comment function is not available (greyed out).


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1