Runs a macro when you double-click any cell or object on the specified sheet or macro sheet or double-click any item on the specified chart.
Syntax
ON.DOUBLECLICK(sheet_text, macro_text)
Sheet_text is a text value specifying the name of a sheet in a workbook. If sheet_text is omitted, the macro is run whenever you double-click any sheet not specified by a previous ON.DOUBLECLICK formula. Sheet_text must be in the form "[book1]sheet1".
Macro_text is the name of, or an R1C1-style reference to, a macro you want to run when you double-click the sheet specified by sheet_text. The name or reference must be in text form. If macro_text is omitted, double-clicking reverts to its normal behavior, and any macros assigned by previous ON.DOUBLECLICK functions are turned off.
Remarks
ON.DOUBLECLICK overrides Microsoft Excel's normal double-click behavior, such as displaying cell notes, displaying the Patterns dialog box, or allowing editing cell text directly in cells.
To determine what cell, object, or chart item has been double-clicked, use a CALLER function in the macro specified by macro_text.
ON.DOUBLECLICK does not affect objects to which ASSIGN.TO.OBJECT macros have already been assigned. Use ON.DOUBLECLICK (TRUE) to make Microsoft Excel carry out the action that would normally occur if you double-click on the current selection.
Related Functions
ASSIGN.TO.OBJECT Assigns a macro to an object
ON.WINDOW Runs a macro when you switch to a window
Return to index