Removing User Name from Comments

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.

  1. Sub RemoveUserNames()
  2. Dim MyComment As Comment
  3. Dim I As Integer
  5. 'Start looping through comments
  6.    For Each MyComment In ActiveSheet.Comments
  8.     'Find the position number of the Colon & LineFeed character combination
  9.        I = InStr(1, MyComment.Shape.TextFrame.Characters.Text, ":" & vbLf)
  11.     'Use the position number to reset the comment text to all but the user name
  12.        If I > 0 Then
  13.             MyComment.Shape.TextFrame.Characters.Text = _
  14.             Mid(MyComment.Shape.TextFrame.Characters.Text, I + 2)
  15.         End If
  17. 'Go to the next comment
  18.    Next MyComment
  20. End Sub

10 thoughts on “Removing User Name from Comments

  1. jeff weir

    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.

  2. amolin

    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:”

  3. Randy

    Excellent macro, but it leaves the comment in Bold. Insert the following line before the EndIf to fix that:

    MyComment.Shape.TextFrame.Characters.Font.Bold = False

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>