Results 1 to 4 of 4

Thread: How to hide comments and comment indicators from OTHERS?

  1. #1

    Question How to hide comments and comment indicators from OTHERS?



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hello! Working on the spreadsheet adding a lot of comments. Need to send this document to the group of people and don't want them to see there are comments (and comment indicators) there. Is it possible to somehow block and hide comments and comment indicators from other people ho will open my spreadsheet on their computers? Can't find how to do it... Only found how to hide comments and indicators on MY computer, bot when I send my spreadsheet out people still see everything. I can not delete comments + indicators before sending as I am continuously working on this file and continuously sending it out. Please, help. Thank you very much in advance!

  2. #2
    Conjurer WizzardOfOz's Avatar
    Join Date
    Sep 2013
    Location
    Australia
    Posts
    184
    Articles
    0
    You could hide them but there is nothing stopping the others from showing them. You could use VBA to extract all your comments to a file and then re-import them. This should do it for you. In your personal macros add this.

    then run Comments2Text to take out all your comments and Text2Comments to put them all back. Macro is quick and dirty and needs a bit of polishing (do you want to overwrite the comment file each time, remove "'s etc)


    Code:
    Option Explicit
    
    
    Sub Comments2Text()
    Dim sHideMe As String
    Dim c As Comment, ws As Worksheet
        
        sHideMe = Left(ActiveWorkbook.FullName, InStr(ActiveWorkbook.FullName, ".")) & "csv"
        Open sHideMe For Output As #1
            sHideMe = Environ("username")
            
            For Each ws In ActiveWorkbook.Worksheets
                For Each c In ws.Comments
                    If InStr(c.Text, sHideMe) > 0 Then
                        Write #1, ws.Name, c.Parent.Address, Replace(c.Text, vbLf, "#_#")
                        c.Delete
                    End If
                Next c
            Next ws
        Close #1
        
    End Sub
    
    
    Sub Text2Comments()
    Dim sHideMe As String, sline As String, sData() As String
    Dim c As Comment, ws As Worksheet
        
        sHideMe = Left(ActiveWorkbook.FullName, InStr(ActiveWorkbook.FullName, ".")) & "csv"
        Open sHideMe For Input As #1
        Do
            Line Input #1, sline
            sline = Replace(Replace(sline, """", ""), "#_#", vbLf)
            sData = Split(sline, ",", 3)
            Worksheets(sData(0)).Range(sData(1)).AddComment sData(2)
                       
        Loop Until EOF(1)
        Close #1
        
    End Sub

  3. #3
    Thank you very much! Could you, please, clarify how I can "hide them but there is nothing stopping the others from showing them"? I think just hiding them and make invisible for a while is what I need. No problem if one of 2 users will find them, don't think they will be checking, so it should be fine. Thank you!

  4. #4
    Conjurer WizzardOfOz's Avatar
    Join Date
    Sep 2013
    Location
    Australia
    Posts
    184
    Articles
    0
    If you want to hide ALL comments (Excel 2010) click on the Menu, Review, Show All Comments (unselect)

    If you only want to hide your comments this should do it.

    Code:
    Sub HideMyComments()
    Dim sHideMe As String
    Dim c As Comment, ws As Worksheet
        
            sHideMe = Environ("username")
            
            For Each ws In ActiveWorkbook.Worksheets
                For Each c In ws.Comments
                    If InStr(c.Text, sHideMe) > 0 Then c.visible = false
                Next c
            Next ws
        
    End Sub

Posting Permissions

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