检测用户何时在Excel 2003中删除了行 [英] Detect when rows have been deleted by user in Excel 2003

查看:89
本文介绍了检测用户何时在Excel 2003中删除了行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel 2003中有一个C#.Net加载项.我希望可以附加一个钩子(事件?),以检测用户何时从活动工作表中删除了一行或几行,例如发生这种情况时,将需要重新计算或丢弃某些缓存.

I have a C#.Net add-in to Excel 2003. I am hoping there is a hook (event?) to which I can attach, to detect when the user has deleted a row or rows from the active worksheet, as some caches will need to be recomputed or discarded when this happens.

是否存在任何此类钩子或事件?如果没有,有没有办法实现我想要的?

Is there any such hook or event? If not, is there a way of achieving what I want?

推荐答案

不幸的是,似乎没有一种检测何时删除行的方法.根据工作表事件列表,您可以使用 Change 事件来确定某些内容已发生更改,然后循环浏览工作表中的所有行以找出发生了什么更改&相应地更新缓存. 可以帮助您通过其他使用方式进行思考以及 Change 方法.

Unfortunately, there doesn't appear to be a way to detect when a row is deleted. According to the Worksheet event list, you could use the Change event to figure out that something has changed, then loop through all rows in the Worksheet to figure out what has changed & update your cache accordingly. This may help you think through other ways of using the Change method as well.

这篇关于检测用户何时在Excel 2003中删除了行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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