XL98: How to Change the Font in a Cell Comment (183848)
The information in this article applies to:
- Microsoft Excel 98 Macintosh Edition
This article was previously published under Q183848 SYMPTOMS
When you record a macro in which you change the font of a cell comment, and
then subsequently rerun the macro, the font of the comment does not change
as you expect.
CAUSE
Depending on the method you used to select the comment while you recorded
the macro, the recorded macro may not contain the necessary code to modify
the font of the cell comment.
RESOLUTIONMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements.
The following sample macro changes the font of the active cell's comment to
a bold Courier font with a font size of 14:
Sub Comment_Font_Change()
With ActiveCell.Comment.Shape.TextFrame.Characters.Font
.Name = "courier"
.Size = 14
.Bold = True
End With
End Sub
You can also change the font of all comments in a worksheet by running the
following macro:
Sub All_Comment_Font_Change()
For Each x In ActiveSheet.Comments
With x.Shape.TextFrame.Characters.Font
.Name = "courier"
.Size = 14
.Bold = True
End With
Next x
End Sub
STATUS
This is by design of Microsoft Excel.
REFERENCES
For more information about the comment object, click the Office Assistant
while in the Visual Basic Editor, type comment click Search, and then
click to view "Comment Object."
NOTE: If the Assistant is hidden, click the Office Assistant button on the
Standard toolbar. If Microsoft Help is not installed on your computer,
please see the following article in the Microsoft Knowledge Base:
179216 OFF98: How to Use the Microsoft Office Installer Program
Modification Type: | Major | Last Reviewed: | 6/17/2005 |
---|
Keywords: | kbdtacode kbhowto kbprb kbProgramming KB183848 |
---|
|