本文介绍了在Microsoft Excel 2010中创建用户审计跟踪的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在Excel 2010中创建一个基本的用户审计跟踪,跟踪不同用户登录PC(共享PC)的某些单元格的更改

I need to create a basic user audit trail in Excel 2010 tracking changes to certain cells by different users not signing into a PC (shared PC)

推荐答案

以下宏监视对

A2 通过 A20

The following macro monitors changes to cells A2 thru A20

任何这些单元格,用户名和日期都记录在单元格的注释中

If a user changes any of these cells, the username and date are recorded in the cell's comment

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

这篇关于在Microsoft Excel 2010中创建用户审计跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 02:37