Microsoft KB Archive/123184

= Microsoft Knowledge Base =

XL: Dialog Control Accelerator Key Is Case Sensitive When Add
Last reviewed: March 27, 1997

Article ID: Q123184

5.00 5.00c 7.00 7.00a | 5.00 5.00a

WINDOWS              | MACINTOSH kbother

The information in this article applies to:


 * Microsoft Excel for Windows, versions 5.0, 5.0c
 * Microsoft Excel for Windows 95, versions 7.0, 7.0a
 * Microsoft Excel for the Macintosh, versions 5.0, 5.0a

SYMPTOMS
When you assign an accelerator key to a control in a dialog box in Microsoft Excel, the key that you assign is case sensitive. For example, if you assign the character "b" (lowercase), the first lowercase b in the text of the control is underlined as the accelerator key, even if an uppercase B appears first in the control text. However, when you run the dialog box, the accelerator key is not case sensitive; you can use the key in upper- or lower-case to select the object.

CAUSE
When you enter a dialog control accelerator key, the first character in the control text that matches the accelerator key that you entered is not necessarily the character that appears underlined when you display the dialog box. This behavior is by design of Microsoft Excel.

When you add an accelerator key to a dialog control, Microsoft Excel searches first for a character in the control text with the case that matches the accelerator key that you entered. If the control text doesn't contain a character with matching case, then the first character in the text that matches the accelerator key that you entered, regardless of case, is used.

For example, if you assign an accelerator key of "b" (lowercase) to an option button with the text "Bob" in a dialog box, the second "b" in the text "Bob" is the character that appears underlined when you display the dialog box.

Note that when you display the dialog box, the accelerator key is not case sensitive; that is, the control is selected when you press either "b", ALT+B or ALT+SHIFT+B (COMMAND+B or COMMAND+SHIFT+B on the Macintosh).