How Check some cells have been updated

M

moonhk

Hi All
I want to keep trace some of cells in Row have been updated, the one
of column update as today and time ? Does formula can handle this ?

eg. A11 or B11 or C11 Updated, the D11 = today + time


moonhkt
 
R

Ryan H

Put this code in your worksheet module. To do this, right click the sheet
tab at the bottom of Excel, click View Code, then paste code below into the
sheet module. This code will put a time stamp in Col. D if any data is
changed in columns A, B, or C. Give it a try. Hope this helps! If so, let
me know, click "YES" below.

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A:C")) Is Nothing Then
Cells(Target.Row, "D") = Format(Now, "mm/dd/yyyy - hh:mm:ss")
End If

End Sub
 
M

moonhk

Put this code in your worksheet module.  To do this, right click thesheet
tab at the bottom of Excel, click View Code, then paste code below into the
sheet module.  This code will put a time stamp in Col. D if any datais
changed in columns A, B, or C.  Give it a try.  Hope this helps!  If so, let
me know, click "YES" below.

Private Sub Worksheet_Change(ByVal Target As Range)

    If Not Intersect(Target, Range("A:C")) Is Nothing Then
        Cells(Target.Row, "D") = Format(Now, "mm/dd/yyyy - hh:mm:ss")
    End If

End Sub

--
Cheers,
Ryan







- 顯示被引用文字 -

Thank. It works. Does formula can handle this ?
 
M

moonhk

A worksheet formula can handle it but you must use circular references.

See John McGimpsey's site.

http://www.mcgimpsey.com/excel/timestamp.html

Gord Dibben  MS Excel MVP






- 顯示被引用文字 -

Thank for your information.

Also for event macro, how to check some column update or not

Not work
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A:B", "G:H")) Is Nothing Then

Cells(Target.Row, "AB") = Format(Now, "mm/dd/yyyy - hh:mm:ss")
End If

End Sub

Work, But need to input or
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A:C")) Is Nothing Or Not
Intersect(Target, Range("G:H")) Is Nothing Then

Cells(Target.Row, "M") = Format(Now, "mm/dd/yyyy - hh:mm:ss")
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top