当用户尝试在单元格中写入时如何获得通知? [英] How to get notify when user is try to write in a cell?

查看:89
本文介绍了当用户尝试在单元格中写入时如何获得通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


您好,


当用户尝试在单元格上写入时调用的事件是什么,以及如何使用该事件,我们可以为该单元格获得旧的和新的价值吗?


还请展示如何使用它的示例?


提前致谢


谢谢


Ankur Ra​​stogi

解决方案

你好,


我想你可以处理
Worksheet.Change事件(Excel)
:当用户或外部链接更改工作表上的单元格时发生。


我们可以使用Worksheet.Change获得该单元格的新值


例如

 Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox Target.Value
End Sub

如果你想要 得到旧价值,我建议你使用
Worksheet.SelectionChange Event(Excel)


问候,


Celeste




Hi ,

What is the event that invoke when user try to write on a cell, and how to use that, can we get old and new value both for that cell?

Please also show the example how to use it?

Thanks in advance

Thanks

Ankur Rastogi

解决方案

Hello,

I think you may handle Worksheet.Change Event (Excel): Occurs when cells on the worksheet are changed by the user or by an external link.

We could get new value for that cell using Worksheet.Change

E.g.

Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox Target.Value
End Sub

If you want to get old value, I would suggest you use Worksheet.SelectionChange Event (Excel).

Regards,

Celeste


这篇关于当用户尝试在单元格中写入时如何获得通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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