+ Reply to Thread
Results 1 to 7 of 7

Help with Date & Time Stamp (Comments)

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: VBA for comments Time and Date Stamp etc. - Multiple cells in one column

    Replace

    If .Address <> "$A$1" Then Exit Sub

    with (for H1:H99)

    If .column <> 8 then exit sub
    If .row < 100 then exit sub

    If you understand the technique it's easily modified
    Elegant Simplicity............. Not Always

  2. #2
    Registered User
    Join Date
    06-13-2013
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: VBA for comments Time and Date Stamp etc. - Multiple cells in one column

    Hi Andy,

    Many thanks for the reply.......replaced the line "If .Address <> "$A$1" Then Exit Sub" with the "If .column <> 8 then exit sub
    If .row < 100 then exit sub"


    so the coding now is;

    Private Sub Worksheet_Change(ByVal Target As Range)
    With Target
    If .Column <> 8 Then Exit Sub
    If .Row < 100 Then Exit Sub
    If IsEmpty(Target) Then Exit Sub
    Dim strNewText$, strCommentOld$, strCommentNew$
    strNewText = .Text
    If Not .Comment Is Nothing Then
    strCommentOld = .Comment.Text & Chr(10) & Chr(10)
    Else
    strCommentOld = ""
    End If
    On Error Resume Next
    .Comment.Delete
    Err.Clear
    .AddComment
    .Comment.Visible = False
    .Comment.Text Text:=strCommentOld & _
    Format(VBA.Now, "MM/DD/YYYY at h:MM AM/PM") & Chr(10) & strNewText
    .Comment.Shape.TextFrame.AutoSize = True
    End With
    End Sub
    Unfortunately it didn't work, so not sure what to do...........

    Apologies, i'm a real amateur with these things, don't understand coding at all and trying to get this sorted for a work project which I've been tasked.........
    Last edited by arlu1201; 06-17-2013 at 07:16 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1