Share via


MouseDown Event

Occurs whenever the user presses a mouse button while the pointer is positioned over the spreadsheet, PivotTable list, or the chart workspace.

Private Sub Object_MouseDown(ByValButtonAsLong, ByValShiftAsLong, ByValxAsLong, ByValyAsLong)

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

Button The mouse button that was released. Returns 1 if the primary mouse button was released, 2 if the secondary mouse button was released, or 4 if the middle mouse button was released.

Shift The state of the SHIFT, CTRL, and ALT keys when the event occurred. Returns 1 if the SHIFT key was pressed, 2 if the CTRL key was pressed, or 4 if the ALT key was pressed. Returns 0 if neither the SHIFT, CTRL, nor ALT keys were pressed.

x The X coordinate of the mouse pointer.

y The Y coordinate of the mouse pointer.

Remarks

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

Applies to | ChartSpace Object | PivotTable Object | Spreadsheet Object

See Also | ButtonClick Event | Click Event | DblClick Event | MouseMove Event | MouseOut Event | MouseOver Event | MouseUp Event