Audit Trail

R

Rich

I would like to build an audit trail into a spreadsheet so that anyone who
opens the file is is logged in a worksheet with user name and time stamp.
What's the easiest / best way to achieve this?
 
M

Mike H

Rich,

Alt+F11 to open VB editor. Double click 'ThisWorkbook' and paste the code
below in on the right. It uses a worksheet called "Audit"

Private Sub Workbook_Open()
Dim LastRow As Long
Set sht = Sheets("Audit")
LastRow = sht.Cells(Cells.Rows.Count, "A").End(xlUp).Row + 1
sht.Cells(LastRow, 1) = Environ("Username")
sht.Cells(LastRow, 2) = Now
End Sub

--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
M

Mike H

Hi,

In case the user doesn't save it may be a good idea to save it with the
openers username by making this the last line in the code

ActiveWorkbook.Save
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
J

JB

Rich,

Check out XLAuditTrail. That might do the trick for you. It gets embedded into your spreadsheet and tracks all activity into an audit trail. www.xlaudittrail.com

Best of luck with it.

JB
I would like to build an audit trail into a spreadsheet so that anyone who
opens the file is is logged in a worksheet with user name and time stamp.
What's the easiest / best way to achieve this?

--
Rich
http://www.rhodes-pefkos.co.uk
http://www.rhodes-lindos.co.uk
On Saturday, April 10, 2010 5:17 AM ozgrid.com wrote:
Look into Track Changes in the Excel Help.

Or, for a VBA method;
http://www.ozgrid.com/VBA/track-changes.htm
//www.cpearson.com/Excel/TrackingWorkbookOpens.aspx[/URL] .

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
 

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

Similar Threads

Audit Trail 1
Audit Trail 2
Unbound Form Audit Trail (Allen Browne) 3
Version Control in Excel 5
Audit Trail 1
Locking Records/Audit Trail 2
Audit Trail Problem 4
Mr Browne's audit trail 8

Top