Skip to content

Latest commit

 

History

History
67 lines (44 loc) · 1.76 KB

Excel.Chart.MouseDown.md

File metadata and controls

67 lines (44 loc) · 1.76 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Chart.MouseDown event (Excel)
vbaxl10.chm500076
vbaxl10.chm500076
Excel.Chart.MouseDown
6c4ef5ce-560e-a7d5-c602-99a999fb5535
04/16/2019
medium

Chart.MouseDown event (Excel)

Occurs when a mouse button is pressed while the pointer is over a chart.

Syntax

expression.MouseDown (Button, Shift, x, y)

expression A variable that represents a Chart object.

Parameters

Name Required/Optional Data type Description
Button Required Long The mouse button that was released. Can be one of the following XlMouseButton constants: xlNoButton, xlPrimaryButton, or xlSecondaryButton.
Shift Required Long The state of the Shift, Ctrl, and AlShift, Ctrl, and AlttShift, Ctrl, and Alt keys when the event occurred. Can be one of or a sum of values.
x Required Long The x coordinate of the mouse pointer in chart object client coordinates.
y Required Long The y coordinate of the mouse pointer in chart object client coordinates.

Return value

Nothing

Remarks

The following table specifies the values for the Shift parameter.

Value Description
0 (zero) No keys
1 Shift key
2 Ctrl key
4 Alt key

Example

This example runs when a mouse button is pressed while the pointer is over a chart.

Private Sub Chart_MouseDown(ByVal Button As Long, _ 
 ByVal Shift As Long, ByVal X As Long, ByVal Y As Long) 
 MsgBox "Button = " & Button & chr$(13) & _ 
 "Shift = " & Shift & chr$(13) & _ 
 "X = " & X & " Y = " & Y 
End Sub

[!includeSupport and feedback]