CHECK.COMMAND macro

Adds or removes a check mark to or from a command name on a menu. A check mark beside a command indicates that the command has been chosen.

Syntax

CHECK.COMMAND(bar_num, menu, command, check, position)

Bar_num    is the menu bar containing the command. Bar_num can be the ID number of a built-in or custom menu bar.

Menu    is the menu containing the command. Menu can be either the name of a menu as text or the number of a menu. Menus are numbered starting with 1 from the left of the screen.

Command    is the command you want to check or the submenu containing the command you want to check. Command can be the name of the command as text or the number of the command; the first command on a menu is in position 1.

Check    is a logical value corresponding to the check mark. If check is TRUE, Microsoft Excel adds a check mark to the command; if FALSE, Microsoft Excel removes the check mark.

position    is the name of a command on a submenu that you want to check.

Remarks

 

Example

The following macro formula adds a check mark to the Sales command on the Weekly menu on a custom menu bar created by the ADD.BAR function in a cell named Reports:

CHECK.COMMAND(Reports, "Weekly", "Sales", TRUE)

Related Functions

ADD.COMMAND   Adds a command to a menu

DELETE.COMMAND   Deletes a command from a menu

ENABLE.COMMAND   Enables or disables a menu or custom command

RENAME.COMMAND   Changes the name of a command or menu

Return to index