Thread: Comments box
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR
 
Posts: n/a
Default Comments box

If the feature becomes aggravating, this version will allow you to toggle it
On and Off by typing "CommentOn" in cell A2.....

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'Upon entering a value in a cell, this macro will attach a Comment Box
'to the cell and insert the current date. It will append existing comments.
If Range("A2").Value = "CommentOn" Then
If ActiveCell.Value < "" Then
ActiveCell.Select
If Selection.Comment Is Nothing Then
Selection.AddComment
Selection.Comment.Visible = True
Selection.Comment.Text Text:=Date & Chr(10)
Selection.Comment.Visible = False
Else
Selection.Comment.Visible = True
Selection.Comment.Text Text:=ActiveCell.Comment.Text & Chr(10) & Date &
Chr(10)
Selection.Comment.Visible = False
End If
End If
Else
End If

End Sub

Vaya con Dios,
Chuck, CABGx3




"CLR" wrote:

This crude Workbook code seems to do it........
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
'Upon entering a value in a cell, this macro will attach a Comment Box
'to the cell and insert the current date. It will append existing comments.
If ActiveCell.Value < "" Then
ActiveCell.Select
If Selection.Comment Is Nothing Then
Selection.AddComment
Selection.Comment.Visible = True
Selection.Comment.Text Text:=Date & Chr(10)
Selection.Comment.Visible = False
Else
Selection.Comment.Visible = True
Selection.Comment.Text Text:=ActiveCell.Comment.Text & Chr(10) & Date &
Chr(10)
Selection.Comment.Visible = False
End If
End If
End Sub



"Jock W" wrote:

Is it possible to have Excel to automatically add a 'comment' with the date
already in the comment to a cell when data is put into that cell?

tia
--
Jock Waddington