lior03
02-23-2006, 12:18 AM
hello
this macro
Sub CommentDateTimeAdd()
'adds comment with date and time,
' positions cursor at end of comment text
Dim strDate As String
Dim cmt As Comment strDate = "dd-mmm-yy hh:mm:ss"
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.text text:=Format(Now, strDate) & Chr(10)
Else cmt.text text:=cmt.text & Chr(10) _ & Format(Now, strDate) & Chr(10)
End If
With cmt.Shape.TextFrame
.Characters.Font.Bold = False
End With
SendKeys "%ie~"
End Sub
puts date and time in a comment .while this macro
Sub commentalony()
Dim cm As Comment
Dim c As Range
For Each c In selection.Cells
c.clearcomments
If Not IsEmpty(c) And c.HasFormula Then
With c.AddComment
.Text Text:="Formula:" & c.Formula
.Shape.TextFrame.AutoSize = True
End With
End If
Next c
End Sub
adds a formula of activecell to a comment.can this macro be merged to one that will present formula in active cell with the time and date comment was created?
thanks
this macro
Sub CommentDateTimeAdd()
'adds comment with date and time,
' positions cursor at end of comment text
Dim strDate As String
Dim cmt As Comment strDate = "dd-mmm-yy hh:mm:ss"
Set cmt = ActiveCell.Comment
If cmt Is Nothing Then
Set cmt = ActiveCell.AddComment
cmt.text text:=Format(Now, strDate) & Chr(10)
Else cmt.text text:=cmt.text & Chr(10) _ & Format(Now, strDate) & Chr(10)
End If
With cmt.Shape.TextFrame
.Characters.Font.Bold = False
End With
SendKeys "%ie~"
End Sub
puts date and time in a comment .while this macro
Sub commentalony()
Dim cm As Comment
Dim c As Range
For Each c In selection.Cells
c.clearcomments
If Not IsEmpty(c) And c.HasFormula Then
With c.AddComment
.Text Text:="Formula:" & c.Formula
.Shape.TextFrame.AutoSize = True
End With
End If
Next c
End Sub
adds a formula of activecell to a comment.can this macro be merged to one that will present formula in active cell with the time and date comment was created?
thanks