Share via


StartEdit Event

 
This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.  

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 Sub Object**_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 Sub Object _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.