How to detect a cell is selected for editing in ex

2019-09-08 07:20发布

I have a range of readonly cells.After that all other cells are editable.I want to know how can I detect this cell editing event.Like if cell A25 is edited,I want to call a procedure. If Cell(A25).edited then do this.Some thing like this

标签: excel vba
2条回答
一夜七次
2楼-- · 2019-09-08 08:17

Though i'm not sure if you can trigger this modification event somehow with VBA, I think there's better way to handle your read-only cells. Set them as protectable in cell format window, and then protect your sheet. After that everybody would be able to edit all the cells except the ones you marked as protectable.

查看更多
Animai°情兽
3楼-- · 2019-09-08 08:18

You need to use the Worksheet_SelectionChange event as highlighted in my answer to one of your other questions.

May I suggest that now would be a good time to go and learn a bit more about Excel events and what you can and can't do with them, rather than asking multiple similar questions?

The following links may help:

http://www.cpearson.com/excel/events.htm

http://www.mvps.org/dmcritchie/excel/event.htm

http://www.ozgrid.com/VBA/ExcelWorkbookEvents.htm

查看更多
登录 后发表回答