Worksheet.BeforeRightClick Event
Occurs when a worksheet is right-clicked, before the default right-click action.
Syntax
expression.BeforeRightClick(Target, Cancel)
expression A variable that represents a Worksheet object.
Parameters
| Name | Required/Optional | Data Type | Description |
|---|---|---|---|
| Target | Required | Range | The cell nearest to the mouse pointer when the right-click occurs. |
| Cancel | Required | Boolean | False when the event occurs. If the event procedure sets this argument to True, the default right-click action doesn't occur when the procedure is finished. |
Remarks
Like other worksheet events, this event doesn't occur if you right-click while the pointer is on a shape or a command bar (a toolbar or menu bar).
Example
This example adds a new menu item to the shortcut menu for cells B1:B10.
| Visual Basic for Applications |
|---|
|