View Single Post
  #1   Report Post  
 
Posts: n/a
Default output date modified if data is entered for multiple rows

Hello,

I'm currently creating an excel programin which i want to create some
vb code that will check to see if a particular row's (from C to AA)
cell has been modified and to then output that modification date to the
corresponding row's AB cell. So for instance...if someone modifies the
cell H7...then the modification date would be outputted to AB7. I have
approximately 100 rows of data that needs this to be done for, and I
can get the code to work for an individual row, but I cant figure out
how to have it check all the rows in my spreadsheet and output it to
the corresponding row. Here is my code for outuputting row 7:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim KeyRows As Range
Dim X As Variant


' The variable KeyCells contains the cells that will
' cause an alert when they are changed.

Set KeyCells = Range("D7:AA7")

If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then

[AB7].Value = "This order was last modified on " & Format(Now,
"dd/mm/yy")

End If
End Sub


Any ideas? Thank you so much!

Rick