![]() ![]() ♦ Pressing Delete generates an event even if the cell is empty to start with. ♦ Adding, editing, or deleting a cell comment does not trigger the Change event. ♦ Changing the formatting of a cell does not trigger the Change event (as expected), but choosing the Edit ^ Clear^ Formats command does trigger the event. Some actions that should trigger the event don't, and other actions that should not trigger the event do! When I ran this procedure, I discovered some interesting quirks. Every time that the Change event occurs, you'll see a message box that displays the address of the range that was changed. After entering this procedure, activate Excel and make some changes to the worksheet by using various techniques. To get a better feel for the types of actions that generate a Change event for a worksheet, enter the preceding procedure in the code module for a Worksheet object. MsgBox "Range " & Target.Address & " was changed." End Sub Private Sub Worksheet_Change(ByVal Target As Excel.Range) ![]() It displays a message box that shows the address of the Target range: The following procedure is executed whenever the worksheet is changed. This Range object represents the changed cell or range that triggered the event. When the Worksheet_Change procedure is executed, it receives a Range object as its Target argument. The Change event is not triggered when a calculation generates a different value for a formula or when an object is added to the sheet. The Change event is triggered when any cell in a worksheet is changed by the user or by a VBA procedure. ![]()
0 Comments
Leave a Reply. |