Audit Trail In Excel 2007

sbecker61

Board Regular
Joined
Dec 29, 2009
Messages
52
Hello, I posted this question before but I don't think I did a good job of explaining it. Sorry about that. here goes again.

Whenever a cell in range N30 to N(x) changes in a worksheet ab, I want the entire row copied to a new tab called "Audit". I also want a timestamp (YYYYMMDD HH:MM:SS AM/PM format) added so I know when the change occurred. I would like the timestamp to be the first column in the Audit tab. I would also like the data to be written to the first empty row in the Audit tab.

My code so far:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 14 Then Target.EntireRow.Copy Destination:=Sheets("Audit").Range("A" & Rows.Count).End(xlUp).Offset(1)
End Sub

Problems I am having:

1) The number 14 just refers to the column N. How do I make it N30 and higher?
2) What code so I use to put the timestamp in the first column?

Thank you in advance.

Steve
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,224,559
Messages
6,179,517
Members
452,921
Latest member
BBQKING

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top