Format comment username

B

Bill

I want a macro that has Note: instead of username, in bold
and then pauses for the rest of the text.
From www.contextures.com I found.

Sub CommentAddOrEdit()
'adds new plain text comment or positions
'cursor at end of existing comment text
Dim cmt As Comment
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment text:="Note: "
End If
SendKeys "%ie~"
End Sub

But how do I make the Note: bold and reset to normal for
text input.

Thanks
 
D

Dave Peterson

A slight change to Debra's code:

Option Explicit

Sub CommentAddOrEdit()

Dim cmt As Comment

Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
ActiveCell.AddComment Text:="Note: "
Set cmt = ActiveCell.Comment
With cmt.Shape.TextFrame.Characters(Start:=1, Length:=6).Font
.Bold = True
End With
End If
SendKeys "%ie~"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top