View Single Post
  #6   Report Post  
Alan
 
Posts: n/a
Default

"Debra Dalgleish" wrote in message
...

The following code will add a comment to the cell that was changed:

'=========================
Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim oldtext As String
Dim newtext As String

With Target
On Error Resume Next
oldtext = .Comment.Text
If Err < 0 Then
.AddComment
End If
On Error GoTo 0
newtext = oldtext & " Changed to " & .Text & _
" by " & Application.UserName & " at " & Now & vbLf
With .Comment
.Text newtext
.Visible = True
.Shape.TextFrame.AutoSize = True
.Visible = True
End With
End With
End Sub
'============================


Hi Debra,

Out of interest, is there any way to hide the cell comment marker?
Obviously we can hide the comment itself, but what about the red
triangle marker?

Also, can we avoid the comment 'popping' up when the cell is selected
with a 'hidden' comment?

Both of those are user annoyance issues rather than anything more
fundamental.

Thanks,

Alan.