Results 1 to 3 of 3
  1. #1
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Comment &Time (Excel 2000)

    Hi all,

    I'm trying to turn a cell pattern color green, and add a comment with a time in the comment.

    Private Sub CMBCON_Click()

    With Selection.Interior
    .ColorIndex = 4
    .Pattern = xlSolid
    .PatternColorIndex = xlAutomatic
    End With
    ActiveCell.Comment.Delete
    With Selection
    .AddComment
    .Comment.Visible = False
    .Comment.Text Text:="Confirmed: " & VBA.Chr(10) _
    & VBA.Format(VBA.Now, "mmm/dd/yyyy hh:mm:ss")
    End With
    End Sub
    Thanks, Darryl.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Comment &Time (Excel 2000)

    And your question is?

    If the cell has no comment yet, the line that deletes the comment will cause an error. You can suppress the error like this:

    On Error Resume Next
    ActiveCell.Comment.Delete
    On Error Goto 0

  3. #3
    4 Star Lounger
    Join Date
    May 2004
    Location
    Toronto, Ontario, Canada
    Posts
    425
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Re: Comment &Time (Excel 2000)

    You're the best Hans

Posting Permissions

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