User name in comments

hp12c

New Member
Joined
Aug 21, 2003
Messages
34
Is it possible to change the default comment format to NOT include the username in the comment?

Thanks.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Yes it is possible. Aside from removing the user name from Excel, which in some versions requires a re-install of Office, here are two macros that you can assign to shortcut keys that will give you a default of no user name in new comments.

The first macro is bare-bones; it creates a new comment and keeps the comment box visible so you can click in it and edit it.

The second macro is heavier; it deletes the old comment if one was there, and sets the Visible property to False while putting you in edit mode to enter comment text, so it's more versatile. Some people hate invoking the SendKeys method, and that can indeed be a volatile proposition, but with some reasonable care you can use the SendKeys to your advantage, as in this case.


Sub Test1()
With ActiveCell
.AddComment Text:=""
.Font.FontStyle = "Regular"
.Comment.Visible = True
End With
End Sub

Sub Test2()
On Error Resume Next
With ActiveCell
.AddComment
.Comment.Visible = False
.Comment.Text Text:=""
End With
SendKeys "%{I}"
SendKeys "{E}"
SendKeys "{ENTER}"
End Sub
 
Upvote 0
If you want to remove the user name from pre-existing comments (macro author not known):
Code:
Option Explicit
Sub ChangeCommentsName()
Dim cmt As Variant
Dim c As Variant

     Set cmt = Worksheets("Sheet1").Comments
     For Each c In cmt
         c.Text "" & Right(c.Text, _
        Len(c.Text) - InStr(c.Text, ":") - 1)
        
     Next
End Sub
Caution:
Only run the macro once in a worksheet. After the user name is removed, the comment is moved up to the first line of the comment box. Running the macro again will start deleting characters from the actual comment.

Regards,

Mike
 
Upvote 0

Forum statistics

Threads
1,214,835
Messages
6,121,880
Members
449,057
Latest member
Moo4247

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top