Add User to comment

N

Nimish

I have a worksheet event that inserts a comment into a changed cell so
that it can be tracked. Multiple employees access the sheet and are
free to change items and I want to hold them accountable for changes.

I have: Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.ColorIndex = 0
On Error Resume Next
Dim curComment As String
curComment = ""
curComment = Target.Comment.Text
If curComment <> "" Then curComment = curComment & Chr(10)
Target.AddComment
Target.Comment.Text Text:=curComment & _
ActiveWorkbook.BuiltinDocumentProperties("Author") & _
Chr(10) & " Rev. " & Format(Date, "yyyy-mm-dd ") & _
Format(Time, "hh:mm")
ActiveCell.Comment.Visible = False
'comment perhaps should be resized
End Sub

How do I include the user name automatically? Perhaps insert the name
that the excel workbook is regsitered to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

getting macro to run 2
Undo doesn't work! 4
Note Code Help 1
referenced file 1
Cell Change to Comment 2
adding text to comment 8
adding comment to cell if value changed 5
comment copy&past! 0

Top