Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

XL2000: Redo Delete Command Does Not Result in a Change Event


View products that this article applies to.

This article was previously published under Q215696

↑ Back to the top


Symptoms

In Microsoft Excel, the Redo Delete command on the Edit menu may not result in a change event as expected when you run a macro attached to the spreadsheet or workbook that is changed.

↑ Back to the top


Cause

This behavior can occur when you use the Redo Delete command on the Edit menu in the manner shown in the following example:
  1. Start Excel, and then press ALT+F11 to start the Microsoft Visual Basic Editor.
  2. In the Project-VBAProject window, double-click Sheet1, and then type the following macro in the module sheet:
    Private Sub Worksheet_Change (ByVal Target As Excel.Range)
       MsgBox "Worksheet_Change event"
    End Sub
    						
    This macro runs when any change is made to sheet 1 of the workbook.
  3. In the Project-VBAProject window, double-click ThisWorkbook, and then type the following code in the code sheet:
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
       MsgBox "Workbook_SheetChange event"
    End Sub
    						
    This macro runs when any change is made to the workbook.
  4. Press ALT+F11 to return to Excel, and then type test in cell A1.

    Note the appearance of the two message boxes from the change event macros that you just created.
  5. Select cell A1, and then on the Edit menu, click Delete.
  6. In the Delete dialog box, accept the default (or click any option), and then click OK.

    Note that both message boxes appear.
  7. On the Edit menu, click Undo Delete.

    Note that the both message boxes appear.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


Keywords: KB215696, kbpending, kbbug

↑ Back to the top

Article Info
Article ID : 215696
Revision : 4
Created on : 9/27/2003
Published on : 9/27/2003
Exists online : False
Views : 233