OnDoubleClick Property

Applies To

Application Object, Chart Object, DialogSheet Object, Module Object, Worksheet Object.

Description

Returns or sets the name of the macro that runs whenever you double-click anywhere on the sheet. Read-write.

Remarks

Setting this property has no effect on a module.

Setting this property for a sheet overrides any macro that may be set for the application.

On a dialog sheet, you must double-click the border of a selected drawing object or control to call the macro assigned by this property.

This property overrides normal double-click behavior in Microsoft Excel, such as editing data in a cell or displaying a formatting dialog box.

Set this property to empty text ("") to remove the macro.

See Also

DoubleClick Method.

Example

This example causes Microsoft Excel to run the macro named "my_DblClick_Macro" when you double-click anywhere on Sheet1.


Worksheets("Sheet1").OnDoubleClick = "my_DblClick_Macro"

This example removes the OnDoubleClick macro.


Worksheets("Sheet1").OnDoubleClick = ""