View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Format some, not all, text in a comment

Another way is to use Instr()

Dim objCom As Comment, strComment As String
strComment = "Man v Animal"
Set objCom = Target.Offset(, 1).AddComment(strComment)
With objCom.Shape.TextFrame
.Characters(InStr(1, objCom.Text, " v ", vbTextCompare),
3).Font.ColorIndex = 3
.Characters(InStr(1, objCom.Text, " v ", vbTextCompare), 3).Font.Bold = True
End With

--
Jacob


"Jock" wrote:

Using "Target.Offset(, 1).AddComment", I can add a comment to a cell which
will display values from UserForm 1 TextBox2 and TextBox3.
In between these two values in the comment, I have placed a " v " (to
indicate one party against the other).
I would like to format this "v" to bold and red.
As both TextBox Values are unknown lengths, how can I achieve this?
Many thanks
--
Traa Dy Liooar

Jock