View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Otto Moehrbach Otto Moehrbach is offline
external usenet poster
 
Posts: 1,090
Default How to Capture log of Activities on each worksheet of a Workbook

Tera
This macro should get you started.
I assumed that you had a sheet named "Log" in which you want all the
activities data placed. I assumed the Log sheet has headers in Columns A:D.
The data is placed in the first empty row below the headers. Change the
"Log" sheet name in the macro to suit.
In the Log sheet, Column A has the name of the sheet in which the activity
took place.
Column B has the cell address.
Column C has the user name.
Column D has the date and time.
Note that ALL activities in ALL sheets (except the Log sheet) are logged by
this code. Come back if you need help with excluding other sheets.
This macro is a workbook event macro and must be placed in the workbook
module. To access that module, right-click on the Excel icon that is
immediately to the left of the word "File" in the menu that runs across the
top of the screen, select "View Code" in the menu that drops down. Paste
this macro into the module that is on the screen. "X" out of the module to
return to your worksheet. HTH Otto
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Dest As Range
If Sh.Name = "Log" Then Exit Sub
Set Dest = Sheets("Log").Range("A" & Rows.Count).End(xlUp).Offset(1)
Application.EnableEvents = False
Dest.Value = Sh.Name
Dest.Offset(, 1).Value = Target.Address(0, 0)
Dest.Offset(, 2).Value = Environ("username")
Dest.Offset(, 3).Value = Now
Application.EnableEvents = True
End Sub
"tera" wrote in message
...
Hi,
My excel workbook is in share mode. I need to capture all the activities
on each worksheet by all users