View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default Format comment username

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


Bill wrote:

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


--

Dave Peterson