Removing User Name from Comments

March 8, 2010 by datapig Leave a reply »

When you insert a comment into Excel, your username is automatically inserted into the comment followed by a colon.  For instance, if you log into your computer using the user name TrunkOfFunk.  Your comments will all start with TrunkOfFunk:.

.

This annoys me to no end.  Theoretically, this "feature" is supposed to tell you who inserted the comments.  I don't think I have ever needed to know that Donna inserted a comment into cell B2. In my opinion, the user name just clutters up the comment. 

.

If you share my distain for the forced username in comments, here is a small procedure that will go through all comments and remove the username.  This is especially handy for those of you who have embarrasing user names like Lou Briccant.

Sub RemoveUserNames()
Dim MyComment As Comment
Dim I As Integer

'Start looping through comments
    For Each MyComment In ActiveSheet.Comments
       
    'Find the position number of the Colon & LineFeed character combination
        I = InStr(1, MyComment.Shape.TextFrame.Characters.Text, ":" & vbLf)
       
    'Use the position number to reset the comment text to all but the user name
        If I> 0 Then
            MyComment.Shape.TextFrame.Characters.Text = _
            Mid(MyComment.Shape.TextFrame.Characters.Text, I + 2)
        End If
       
'Go to the next comment
    Next MyComment
   
End Sub

Advertisement

6 Responses

  1. Lou Briccant says:

    This will certainly help...thanks!

  2. Isaac Hunt says:

    me too!!!!

  3. Eric Shun says:

    me three!!!!

  4. Eva Brick says:

    Me four :-)

  5. jeff weir says:

    I used to think user names were a feature, because when I changed my username to God less people tended to argue with my comments.

    But recently, people have been commenting back with "which one". So now I'm converted, if you'll pardon the pun.

  6. amolin says:

    we avoid the annoyance by setting: Options-->General->Usename.

    If you have Usename in Comment, you can remove it by setting: Options-->Security-->Remove Personal information from file properties on save. User name in Comment wil change to "Author:"

Leave a Reply