ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Date function to record changes within a row (https://www.excelbanter.com/excel-worksheet-functions/132612-date-function-record-changes-within-row.html)

Kamran

Date function to record changes within a row
 
Hello,
Is there any worksheet function available that will record the date when a
change is made to a specific row? For example, I have a worksheet tracking
several projects with cost, project manager, etc. Anytime there is a change
to one of those items, I would like the "Date Last Edited" column to update
in that row only. Can this be done?
Thanks.

Don Guillett

Date function to record changes within a row
 
Right click sheet tabview codeinsert thismodify to suit

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row < 14 Then Exit Sub
Application.EnableEvents = False
Cells(Target.Row, "a") = Time '"Changed"
Application.EnableEvents = True
End Sub

--
Don Guillett
SalesAid Software

"Kamran" wrote in message
...
Hello,
Is there any worksheet function available that will record the date when a
change is made to a specific row? For example, I have a worksheet
tracking
several projects with cost, project manager, etc. Anytime there is a
change
to one of those items, I would like the "Date Last Edited" column to
update
in that row only. Can this be done?
Thanks.




Gord Dibben

Date function to record changes within a row
 
There is no reliable worksheet function to enter a static date other than to hit
CTRL + ;(semi-colon) for date or CTRL + SHIFT + ; to enter static time.

Here is code that will update Column F any time a change is made to cells in
columns A:E

Adjust to accommodate "etc."

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count 1 Then Exit Sub
If Not Intersect(Range("A:E"), .Cells) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(.Value) Then
Cells(.Row, "F").ClearContents
Else
With .Offset(0, 1)
Cells(.Row, "F").Value = Now
End With
End If
Application.EnableEvents = True
End If
End With
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code".

Copy/paste the above into that sheet module.


Gord Dibben MS Excel MVP



On Tue, 27 Feb 2007 14:08:33 -0800, Kamran
wrote:

Hello,
Is there any worksheet function available that will record the date when a
change is made to a specific row? For example, I have a worksheet tracking
several projects with cost, project manager, etc. Anytime there is a change
to one of those items, I would like the "Date Last Edited" column to update
in that row only. Can this be done?
Thanks.




All times are GMT +1. The time now is 02:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com