Results 1 to 6 of 6

Thread: comment time

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Mentor
    Joined
    Jun 2005
    Posts
    374
    Location

    comment time

    hello
    this macro
    [VBA]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
    [/VBA]
    puts date and time in a comment .while this macro
    [VBA]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
    [/VBA] 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
    Last edited by mdmackillop; 02-23-2006 at 03:50 PM. Reason: Breaks added
    moshe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •