StartEdit Event

StartEdit event as it applies to the Spreadsheet object.

Occurs whenever the user enters edit mode while the mouse pointer is in a cell.

Private SubObject**_StartEdit** (ByValSelectionAsObject, ByValInitialValueAsByRef, ByValCancelAsByRef, ByValErrorDescriptionAsByRef)

*Object    * The name of the Spreadsheet object that you are trapping this event for.

*Selection   * The currently selected range of cells.

*InitialValue    * Use the Value property of this object to return or set the initial value to be used when editing a cell.

*Cancel    * Set the Value property of this object to True to prevent the user from entering edit mode.

*ErrorDescription   * Set the Value property of this object to a message that you want to display to the user.

StartEdit Event as it applies to the PivotTable object.

Occurs whenever the user enters edit mode in a detail cell.

Private SubObject**_StartEdit** (ByValSelectionAsObject, ByValActiveObjectAsObject, ByValInitialValueAsByRef, ByValArrowModeAsByRef, ByValCaretPositionAsByRef, ByValCancelAsByRef, ByValErrorDescriptionAsByRef)

*Object    * The name of the PivotTable object that you are trapping this event for.

*Selection   * The currently selected range of cells.

*ActiveObject   * The active object.

*InitialValue   * Use the Value property of this object to return or set the initial value to be used when editing a cell.

PivotArrowModeEnum

PivotArrowModeEnum can be one of these PivotArrowModeEnum constants.
plArrowModeAccept Accept the edit and move to the next cell.
plArrowModeEdit Move the insertion point left or right one position within the cell.

PivotCaretPositionEnum

PivotCaretPositionEnum can be one of these PivotCaretPositionEnum constants.
plCaretPositionAtEnd
plCaretPositionAtMouse   

*Cancel    * Set the Value property of this object to True to prevent the user from entering edit mode.

*ErrorDescription   * Set the Value property of this object to a message that you want to display to the user.

Remarks

For information about using events with VBScript, see Declaring and Using Event Procedures in VBScript .

Applies to | PivotTable Object | Spreadsheet Object