ich habe per VBA dem Kommentar einer Zelle eine Zeile hinzugefügt und möchte nun, dass diese Zeile fett dargestellt wird. Weiss jemand wie das mit VBA geht ohne den gesamten Kommentartext fett zu schreiben?
Viele Grüße
Jens
Sub Beispiel()
Dim objCom As Comment
Dim A As Long
Const strText As String = "Tino"
'Kommentar erstellen
On Error Resume Next
Set objCom = Range("A1").Comment
If objCom Is Nothing Then
Set objCom = Range("A1").AddComment
End If
On Error GoTo 0
'Text in Kommentar schreiben
objCom.Text ("Jens" & Chr(10) & strText & Chr(10) & "Jens")
A = InStr(objCom.Text, strText)
'bestimmten Text Formatieren
With objCom.Shape.TextFrame.Characters(A, Len(strText) + 1).Font
.Name = "Arial"
.FontStyle = "Fett"
.Size = 12
End With
End Sub
Gruß Tino