SheetBeforeRightClick Event

Applies To

Application object, Workbook object.

Description

Occurs when any worksheet is right-clicked, before the default right-click action.

Syntax

Private Sub object_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range,
úByVal Cancel As Boolean)

object Application or Workbook.

Sh A Worksheet object that represents the sheet.

Target The cell nearest to the mouse pointer when the right-click occurred.

Cancel False when the event occurs. If the event procedure sets this argument to True, the default right-click action isn't performed when the procedure is finished.

Remarks

This event doesn't occur on chart sheets.

See Also

BeforeDoubleClick event, BeforeRightClick event, SheetBeforeDoubleClick event.

Example

This example disables the default right-click action. For another example, see the BeforeRightClick event example.

Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
        ByVal Target As Range, ByVal Cancel As Boolean)
    Cancel = True
End Sub