XL98: Sample Macro to Remove User Name from CommentID: Q184098
|
By default, the text of a cell comment contains the user name in the first
line of the comment. There is no built-in feature that automatically
prevents the user name from being inserted in the comment text. However,
you can use a Visual Basic for Applications macro to insert a blank
comment. This article contains a macro example that inserts a blank comment
in the active cell.
NOTE: The user name that is displayed in the comment is the same name that
appears in the User Name box when you click Preferences on the Tools menu,
and then click the General tab.
Microsoft provides programming examples for illustration only, without
warranty either expressed or implied, including, but not limited to, the
implied warranties of merchantability and/or fitness for a particular
purpose. This article assumes that you are familiar with the programming
language being demonstrated and the tools used to create and debug
procedures. Microsoft Support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to
provide added functionality or construct procedures to meet your specific
needs. If you have limited programming experience, you may want to contact
the Microsoft fee-based consulting line at (800) 936-5200. For more
information about the support options available from Microsoft, please see
the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/
Sub New_Comment()
ActiveCell.AddComment ""
ActiveCell.Comment.Visible = True
End Sub
Sub Fancy_Comment()
ActiveCell.AddComment ""
'Create the comment.
ActiveCell.Comment.Visible = True
ActiveCell.Comment.Shape.Select
With Selection
.ShapeRange.AutoShapeType = _ ' Set the AutoShape.
msoShapeExplosion2
.ShapeRange.Fill.PresetGradient _ ' Set background color.
msoGradientHorizontal, 1, _
msoGradientHorizon
.Font.Name = "Arial" ' Set the font.
.Font.FontStyle = "Bold Italic"
End With
End Sub
For more information about cell comments, click Contents And Index on the Help menu (or on the Balloon Help menu if you are using a version of the Macintosh operating system earlier than 8.0), click the Index button in Microsoft Excel Help, type the following text
comments, overview
and then click Show Topics. Select the "About adding comments and
highlighting changes in a workbook" topic, and click Go To. If you are
unable to find the information you need, ask the Office Assistant.
Additional query words: XL98 note
Keywords : kbprg kbdta kbdtacode xlui xlvbahowto OffVBA xlmac
Version : MACINTOSH:98
Platform : MACINTOSH
Issue type : kbhowto
Last Reviewed: June 11, 1999