need help.

  • Thread starter Thread starter Smart Akhtar
  • Start date Start date
S

Smart Akhtar

Hi,
I have one workbook. which is use by many user on single location.
I want to create the log report for that file. means who worked last
time on that file and I also want a report should be create in excel
sheet.
Please help me with code .

Thanks in advance.
 
First put this macro in the workbook code area:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Activate
n = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(n, 1).Value = Environ("username")
Cells(n, 2).Value = Date
End Sub

The log will be in Sheet1, (change to suit). Whenever a user saves the
workbook, the username will be recorded in column A and the date in column B.
 
First put this macro in the workbook code area:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Sheets("Sheet1").Activate
n = Cells(Rows.Count, 1).End(xlUp).Row + 1
Cells(n, 1).Value = Environ("username")
Cells(n, 2).Value = Date
End Sub

The log will be in Sheet1, (change to suit).  Whenever a user saves the
workbook, the username will be recorded in column A and the date in columnB.
--
Gary''s Student - gsnu2007g






- Show quoted text -

Thanks a lot
 

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

Back
Top