Textformat
08.05.2008 12:33:37
Ralf_P
wie muss denn der Code lauten, um den letzten Eintrag im Kommentar Fett darzustellen?
Mit Format(Target.Value, "Font.Bold") geht es offensichtlich nicht.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cmt As Comment
Dim sCmt As String
If Target.Address = "$A$1" Then Exit Sub
sCmt = Application.UserName & " - " & _
Format(Now, "dd.mm.yy hh:mm") & " - " & _
Format(Target.Value, "Font.Bold")
If Not Target.Comment Is Nothing Then
sCmt = Target.Comment.Text & vbLf & sCmt
Target.Comment.Delete
End If
Set cmt = Target.AddComment(sCmt)
cmt.Shape.TextFrame.AutoSize = True
End Sub
Gruß Ralf