Customised Cell Comments
This is a small piece of code showing how to customise your cell comments to make it look better. The code works fine in Excel 2003. Some R&D is required to find out why font color applied in Excel 2007 is not correct.
To make it work in Excel 2007 use ColorIndex instead of Color.
Sub ModifyCellComment() Dim cmt As Comment Dim shp As Shape Set cmt = Range("rngModified").Comment Set shp = cmt.Shape With shp With .TextFrame.Characters.Font .Size = Range("rngFormat").Font.Size .Bold = Range("rngFormat").Font.Bold .Name = Range("rngFormat").Font.Name .Color = Range("rngFormat").Font.Color End With .Fill.ForeColor.RGB = Range("rngFormat").Interior.Color 'Color of first character of comment .TextFrame.Characters(1, 1).Font.Color = Range("rngFirstChar").Interior.Color .Fill.Solid End With Set cmt = Nothing Set shp = Nothing End Sub
Attachment | Size |
---|---|
Comments.xls | 40.5 KB |
»
- Vishesh's blog
- Login or register to post comments
- 7439 reads
Recent comments
5 years 34 weeks ago
6 years 20 weeks ago
6 years 32 weeks ago
6 years 35 weeks ago
6 years 36 weeks ago
6 years 42 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago
6 years 50 weeks ago