title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Workbook.SheetBeforeRightClick event (Excel) |
vbaxl10.chm503087 |
|
|
d84dd9fd-85d3-009e-281b-cfc0d2874859 |
05/29/2019 |
medium |
Occurs when any worksheet is right-clicked, before the default right-click action.
expression.SheetBeforeRightClick (Sh, Target, Cancel)
expression An expression that returns a Workbook object.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Sh | Required | Object | A Worksheet object that represents the sheet. |
Target | Required | Range | The cell nearest to the mouse pointer when the right-click occurred. |
Cancel | Required | Boolean | 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. |
This event doesn't occur on chart sheets.
This example disables the default right-click action.
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
ByVal Target As Range, Cancel As Boolean)
Cancel = True
End Sub
For another example, see the BeforeRightClick event example.
[!includeSupport and feedback]