Try this
Option Explicit
Sub KeyCellsChanged()
Dim strDate As String
Dim cmt As Comment
Dim Username As String
Dim strCommentText As String
strDate = "ddmmmyy hh:mm"
Username = Application.Username
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
With cmt
.Text (Username & " " & Format(Now, strDate) & Chr(10))
.Shape.TextFrame.Characters(1, Len(Username)).Font.Bold =
True
End With
Else
Set cmt = ActiveCell.Comment
strCommentText = cmt.Text
With cmt
.Text ("")
.Shape.TextFrame.Characters(1, Len(cmt.Text)).Font.Bold =
False
.Text (Username)
.Shape.TextFrame.Characters(1, Len(Username) - 1).Font.Bold =
True
.Text (cmt.Text & " " & Format(Now(), strDate)) & Chr(10) &
strCommentText
.Shape.TextFrame.Characters(Len(Username) + 1).Font.Bold =
False
End With
End If
End Sub
--
bgeier
------------------------------------------------------------------------
bgeier's Profile:
http://www.excelforum.com/member.php...o&userid=12822
View this thread:
http://www.excelforum.com/showthread...hreadid=543465