ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Question about Comments (https://www.excelbanter.com/excel-programming/412288-question-about-comments.html)

kirkm[_7_]

Question about Comments
 

Is it possible to BOLD the first line only (in a comment)
by code ? ( I can do it manually).

I have variables holding the row and column and have confirmed
a comment does exist in that cell.

Thanks - Kirk

stefan onken

Question about Comments
 
hi Kirk,
try this code

Sub BoldFirstLineOfComment()
With Range("A1").Comment
l = InStr(.Text, Chr(10))
..Shape.TextFrame.Characters(1, l).Font.Bold = True
End With
End Sub

you can use SpecialCells(xlCellTypeComments), if you want to change
all comments in a sheet.

stefan

On 9 Jun., 07:10, kirkm wrote:
Is it possible to BOLD the first line only (in a comment)
by code ? ( I can do it manually).

I have variables holding the row and column and have confirmed
a comment does exist in that cell.

Thanks - Kirk



kirkm[_7_]

Question about Comments
 
On Mon, 9 Jun 2008 02:18:20 -0700 (PDT), stefan onken
wrote:

Sub BoldFirstLineOfComment()
With Range("A1").Comment
l = InStr(.Text, Chr(10))
.Shape.TextFrame.Characters(1, l).Font.Bold = True
End With
End Sub


Many thanks indeed. Works spot on !

Cheers - Kirk

PS This thing I'm doing just about makes the tea & toast Now :)


All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com