在 microsoft excel 2010 中创建用户审计跟踪 [英] create user audit trail in microsoft excel 2010

查看:19
本文介绍了在 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)

推荐答案

以下宏监控单元格A2A20

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

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 中创建用户审计跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆