跟踪共享驱动器用户名和开放时间在Excel中?

我发现了一个关于我的问题的类似文章,如下所述;

如何跟踪谁使用我的Excel电子表格?

但是,我喜欢评论的最后一个栏目>>“你也可以在下一栏中加上时间戳来显示电子表格的使用时间”

我的问题是>任何人都可以引导我可能的步骤,或者让我复制这样做的代码吗? 以及如何隐藏工作表没有人注意到? 我的关键是,非常重要的是,一切都必须默默无声地完成,没有其他人(共享驱动器中的其他用户)能够发现它跟踪它。 原因是,我做了大量的研究工作表,我没有时间/不可能让每一个excel工作表都完美,我需要优先考虑他们,以便通过知道哪一个更重要。

非常感谢〜!

在Excel中,在“审阅”选项卡下,您有“追踪更改”。 这应该做你想要的一切。

如果您想要VBA脚本来执行此操作,请尝试以下代码示例之一。

 Private Sub Worksheet_Change(ByVal Target As Range) Set t = Target Set a = Range("A:A") If Intersect(t, a) Is Nothing Then Exit Sub Application.EnableEvents = False t.Offset(0, 7).Value = Environ("username") Application.EnableEvents = True End Sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) Dim V As Long Application.EnableEvents = False Set rng1 = Application.Union(Range("a1:g1"), Range("H:iv")) Set rng = Application.Intersect(Target, rng1) If Not rng Is Nothing Then Exit Sub V = Target.Offset(0, 12).Value If Target.Offset(0, 12) = "" Then With Range("H" & Target.Row) .Value = Target.Address & ": first entry by " & Application.UserName & " at " & Now() .ColumnWidth = 60 .Interior.ColorIndex = 33 End With Target.Offset(0, 12).Value = Target.Value Application.EnableEvents = True Exit Sub End If Target.Offset(0, 12).Value = Target.Value With Range("H" & Target.Row) .Value = Target.Address & " changed from " & V & " to " & Target.Value & " by " & Application.UserName & " at " & Now() .ColumnWidth = 60 .Interior.Color = vbYellow End With Application.EnableEvents = True End Sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) With Target If .Count > 1 Then Exit Sub If Not Intersect(Range("A2:A10"), .Cells) Is Nothing Then Application.EnableEvents = False Sheets("Sheet2").Select If IsEmpty(.Value) Then .Offset(0, 1).ClearContents Else With .Offset(0, 1) .NumberFormat = "dd mmm yyyy hh:mm:ss" .Value = Now End With End If Sheets("Sheet1").Select Application.EnableEvents = True End If End With End Sub 

所有这些“Worksheet_Change”脚本都是工作表事件。 您需要右键单击您的工作表,然后单击“查看代码”,然后将脚本粘贴到打开的窗口中。 一次尝试一个,而不是全部三个在一起。