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.
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Tom Urtis

MrExcel MVP
Joined
Feb 10, 2002
Messages
11,224
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
 

Ekim

Well-known Member
Joined
Jun 30, 2002
Messages
1,416
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,214
Messages
5,594,881
Members
413,947
Latest member
gizmolucy

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
Top