Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在microsoft excel 2010中创建用户审核跟踪_Excel_Vba_Audit_Trail - Fatal编程技术网

在microsoft excel 2010中创建用户审核跟踪

在microsoft excel 2010中创建用户审核跟踪,excel,vba,audit,trail,Excel,Vba,Audit,Trail,我需要在Excel 2010中创建一个基本的用户审核跟踪,跟踪未登录到PC(共享PC)的不同用户对某些单元格的更改。以下宏监视对单元格的更改A2到A20 如果用户更改了这些单元格中的任何一个,则用户名和日期将记录在单元格的注释中 Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count > 1 Then Exit Sub If Intersect(Target, Range("A2:A20"))

我需要在Excel 2010中创建一个基本的用户审核跟踪,跟踪未登录到PC(共享PC)的不同用户对某些单元格的更改。以下宏监视对单元格的更改A2A20

如果用户更改了这些单元格中的任何一个,则用户名和日期将记录在单元格的注释中

Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Intersect(Target, Range("A2:A20")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    Dim s As String
    s = Now & vbCrLf & Environ("UserName")
        With Target
            .ClearComments
            .AddComment s
        End With
    Application.EnableEvents = True
End Sub

这里没有足够的细节。你到底想追踪什么?请尝试更清楚地解释你的问题,以便你能得到问题的具体答案。“我需要”这类问题通常过于宽泛,难以准确回答。