How to hide comments and comment indicators from OTHERS?

Elena A

New member
Joined
Dec 3, 2014
Messages
2
Reaction score
0
Points
0
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!
 
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
 
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!
 
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
 
Back
Top