跳到主要内容

如何在Excel中监视单元格的变化?

如果在Excel中更改了数据,如何监视工作表单元格? 这可能有助于您尽快识别更改的单元格。 本文,我将讨论一些有趣的方法来处理Excel中的此任务。

使用“跟踪更改”功能监视Excel中的单元格更改

使用VBA代码监控Excel中的单元格更改


箭头蓝色右气泡 使用“跟踪更改”功能监视Excel中的单元格更改

Excel有一个有用的 跟踪变化 功能,它可以帮助您标记已更改的单元格,请执行以下操作:

1。 点击 评论 > 跟踪变化 > 突出显示更改,请参见屏幕截图:

文档监控器更改1

2。 在 突出显示更改 对话框中,进行以下操作:

(1.)检查 在编辑时跟踪更改。 这也共享您的工作簿.

(2.)在 突出显示哪些变化 部分,根据需要指定“何时”,“谁”和“地点”项目。

(3.)最后检查 在屏幕上突出显示更改 选项。

文档监控器更改2

3。 完成设置后,单击 OK 按钮,现在,当您更改指定单元格中的任何单元格值时,更改后的单元格周围带有三角形图标的边框,请参见屏幕截图:

文档监控器更改3

备注:使用这种方法,您的工作簿将成为共享工作簿。


箭头蓝色右气泡 使用VBA代码监控Excel中的单元格更改

以下VBA代码还可以帮助您监视更改后的单元格值,请按以下步骤操作:

1。 右键单击要监视单元格更改的工作表选项卡,然后选择 查看代码 从上下文菜单中,在打开的 Microsoft Visual Basic应用程序 窗口,请复制以下VBA代码并将其粘贴到模块中:

VBA代码:监视Excel工作表中的单元格更改:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160728
    Dim xrng As Range
    Set xrng = Range("A1:E7")
    If Not Application.Intersect(xrng, Range(Target.Address)) _
           Is Nothing Then
        MsgBox "Cell " & Target.Address & " has changed.", vbInformation, "Kutools for Excel"
    End If
End Sub

文档监控器更改4

请注意: 在上面的代码中, A1:E7 是单元格更改时要监视的数据范围,可以根据需要进行更改。

2。 然后保存并关闭此代码窗口,现在,当您在指定范围内更改单元格值时,将弹出一个消息框提醒您,请参见屏幕截图:

文档监控器更改5

最佳办公生产力工具

🤖 Kutools 人工智能助手:基于以下内容彻底改变数据分析: 智能执行   |  生成代码  |  创建自定义公式  |  分析数据并生成图表  |  调用 Kutools 函数...
热门特色: 查找、突出显示或识别重复项   |  删除空白行   |  合并列或单元格而不丢失数据   |   不使用公式进行四舍五入 ...
超级查询: 多条件VLookup    多值VLookup  |   跨多个工作表的 VLookup   |   模糊查询 ....
高级下拉列表: 快速创建下拉列表   |  依赖下拉列表   |  多选下拉列表 ....
列管理器: 添加特定数量的列  |  移动列  |  切换隐藏列的可见性状态  |  比较范围和列 ...
特色功能: 网格焦点   |  设计图   |   大方程式酒吧    工作簿和工作表管理器   |  资源库 (自动文本)   |  日期选择器   |  合并工作表   |  加密/解密单元格    按列表发送电子邮件   |  超级筛选   |   特殊过滤器 (过滤粗体/斜体/删除线...)...
前 15 个工具集12 文本 工具 (添加文本, 删除字符,...)   |   50+ 图表 类型 (甘特图,...)   |   40+ 实用 公式 (根据生日计算年龄,...)   |   19 插入 工具 (插入二维码, 从路径插入图片,...)   |   12 转化 工具 (小写金额转大写, 货币兑换,...)   |   7 合并与拆分 工具 (高级组合行, 分裂细胞,...)   |   ... 和更多

使用 Kutools for Excel 增强您的 Excel 技能,体验前所未有的效率。 Kutools for Excel 提供了 300 多种高级功能来提高生产力并节省时间。  单击此处获取您最需要的功能...

产品描述


Office Tab 为 Office 带来选项卡式界面,让您的工作更加轻松

  • 在Word,Excel,PowerPoint中启用选项卡式编辑和阅读,发布者,Access,Visio和Project。
  • 在同一窗口的新选项卡中而不是在新窗口中打开并创建多个文档。
  • 每天将您的工作效率提高50%,并减少数百次鼠标单击!
Comments (7)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Merhaba. WhatsApp üzerinden bana gelen bir excell dosyası var. Bunu bilgisayar üstünden açıp. Bunda ki hareketleri ve değişiklikleri görme şansım var mı ?
This comment was minimized by the moderator on the site
I got "syntax error" with "Dim xrng As Range" when I inserted the below code in my worksheet_change event :-(
VBA code: Monitor cell changes in Excel worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160728
    Dim xrng As Range
    Set xrng = Range("A1:E7")
    If Not Application.Intersect(xrng, Range(Target.Address)) _
           Is Nothing Then
        MsgBox "Cell " & Target.Address & " has changed.", vbInformation, "Kutools for Excel"
    End If
End Sub
This comment was minimized by the moderator on the site
if i have large amount of data in excel file, and i just want to know status in one different colum that if any cell gets change its value then it should indicate in from of that cell's row , tha status shoild be changed, how can i do this
This comment was minimized by the moderator on the site
hello how can we track by date and time in the change in the cell
This comment was minimized by the moderator on the site
Woooow this is nowhere else except here! Amazing!

Is there any way to insert a row right below the row of the cell where the cell was updated?

To make it more challenging, if I have list validation enabled or formula enabled can that as well be copied to the new row?
This comment was minimized by the moderator on the site
Hi, amar,
To insert a row below the changed value, the following VBA code can help you, please try it.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRg As Range
Dim xStrPre, xStr As String
On Error Resume Next
Set xRg = Range("A1:E7")
If Intersect(xRg, Target) Is Nothing Then Exit Sub
Application.EnableEvents = False
xStr = Target.Value
Application.Undo
xStrPre = Target.Value
Target.Offset(1, 0).EntireRow.Insert xlShiftDown
Target.Offset(1, 0).Value = xStrPre
Target.Value = xStr
Application.EnableEvents = True
End Sub
This comment was minimized by the moderator on the site
Hello, I have it copying old number to new line - how do I have the new line go to a new tab instead?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations