Skip to main content

VCL Spreadsheets: Supported Keystrokes

  • 17 minutes to read

In addition to the file format compatibility with popular spreadsheet-based applications, both the Spreadsheet and Report Designer controls provide a familiar Excel-like end-user environment, including multiple customizable user interface elements and corresponding keyboard support.

The Spreadsheet controls supports over 70 keys and key combinations available in Microsoft Excel®. All currently supported keyboard controls are listed in the following table:

Arrow Keys

Pressing an arrow key produces different effects depending on what object is selected and/or focused in the control:

  • If a cell is focused, pressing the Left, Up, Right, or Down key moves focus to the left, top, right, or bottom adjacent cell.

  • If a cell range is selected, pressing the Left, Up, Right, or Down arrow key clears the selection and shifts focus by one cell in the respective direction.

  • If the focused cell is located at the left, top, right, or bottom edge of the worksheet area, pressing the Left, Up, Right, or Down key does not move focus.

  • If a floating container is focused, pressing an arrow key moves it by one pixel in the respective direction within the worksheet area.

Delete

Pressing the Del key produces different effects depending on what object is selected and/or focused in the control:

End

Moves focus to a cell following the rightmost cell object within the same row. If there are no cell objects in this row, the focus is moved to its first (i.e., the leftmost) cell.

Enter / Shift+Enter

Pressing the Enter key or the Shift+Enter key combination produces different effects depending on what object is selected and/or focused in the control:

  • If a cell is focused within a Table View worksheet, pressing the Enter key moves focus to the next (i.e., underlying) cell within the same column. If the last cell in a column is focused, the Enter key moves focus to the topmost cell in the next (i.e., the right adjoining) column. If the last cell in the last (i.e., the rightmost) column is focused, pressing the Enter key sets the focus to the top cell in the worksheet’s leftmost column.

  • Additionally, if the active worksheet is protected and the Spreadsheet control’s OptionsBehavior.EnterKeyNavigation property is set to eknSkipLockedCells, the Enter key omits all locked cells moving focus to the next unlocked cell within the same column.

  • If a cell range is selected, pressing the Enter key moves cell focus within the range’s boundaries in the same manner as described above. In the case of multiple selected cell ranges, the Enter key consecutively moves cell focus through all selected areas in the ascending order of their indexes within the active Table View worksheet’s collection of selections.

Both the Enter key and the Shift+Enter key combination close an in-place cell editor accepting its current contents as a new cell value. The cell focus shifts identically to the cases described above.

The Shift+Enter key combination moves focus identically to the Enter key but in the opposite direction.

Esc

Pressing the Esc key produces different effects depending on what object is selected and/or focused in the control:

  • If an in-place editor is open, this key closes it and discards any cell content modifications.

  • If a floating container is focused, this key returns focus to the previously focused cell.

  • If cell data was cut or copied to the clipboard, this key clears it.

F2

Opens an in-place editor for the focused cell.

F9

Recalculates all formula expressions within the current spreadsheet document. Pressing the F9 key invokes the control’s FormulaController.Calculate procedure.

Home

Moves cell focus to the leftmost (i.e., the first) cell in the current row.

PgDn

Scrolls the active worksheet down by the number of rows currently displayed by the control. To quickly scroll the worksheet up, press the PgUp key.

PgUp

Scrolls the active worksheet up by the number of rows currently displayed by the control. To quickly scroll the worksheet down, press the PgDn key.

Tab / Shift+Tab

Pressing the Tab key or the Shift+Tab key combination produces different effects depending on what object is selected and/or focused in the control:

  • If a floating container is selected, except for comments, pressing the Tab key consecutively moves focus between containers in ascending order of their indexes within the active worksheet’s collection.

  • If a cell is focused within a Table View worksheet, pressing the Tab key moves focus to the next (i.e., the right adjoining) cell within the same row. If the last cell in a row is focused, the Tab key moves focus to the first cell on the next (i.e., the lower adjacent) row. If the last cell in the last row is focused, pressing the Tab key sets the focus to the first cell in the worksheet’s topmost row.

  • If a cell range is selected, pressing the Tab key moves the cell focus within the range’s boundaries in the same manner as described above. In the case of multiple selected cell ranges, the Tab key consecutively moves the cell focus through all selected areas in the ascending order of their indexes within the active Table View worksheet’s collection of selections.

  • Both the key combinations close an in-place cell editor, accepting its current contents as a new cell value. The cell focus shifts identically to the cases described above.

The Shift+Tab key combination moves focus identically to the Tab key but in the opposite direction.

Alt+Arrow Keys

If a cell is focused in the active worksheet, the Alt key is ignored. Therefore, the arrow keys move the cell focus as described in the Arrow Keys section.

If a floating container is focused instead of a cell, adding the Alt key to a combination provides the following options:

  • The Alt+Left key combination rotates the focused container around its center by 15 degrees counterclockwise;

  • The Alt+Right key combination rotates the focused container around its center by 15 degrees clockwise.

Since geometric transformations cannot be applied to comments, neither the Alt+Left nor Alt+Right key combination affects the focused comment container.

The Alt+Up and Alt+Down key combinations are always ignored.

Alt+Backspace / Ctrl+Z

Returns the currently opened spreadsheet document into the state it was in before performing the last saved action. Technically, this key combination invokes the Undo procedure with the default parameter, moving the last history action object from UndoActions to the RedoActions list.

Pressing the Ctrl+Z or Alt+Backspace key combination is equivalent to executing the Undo command. If the history functionality is not enabled in the Spreadsheet control by setting its OptionsBehavior.History property to True, pressing this key combination has no effect.

Alt+Enter

Starts a new line within the open in-place cell editor.

Ctrl+;

Enters the current date into the focused cell.

Ctrl+`

Switches between displaying formula expressions and their calculated results in the active worksheet.

Ctrl+’

Copies the formula expression to the focused cell from the adjacent cell above.

Ctrl+1

Displays the Format Cells dialog for the current cell selection.

Ctrl+2 / Ctrl+B

Adds/removes the Bold attribute to/from the current font used to display:

  • The values in all selected cells.
  • The text selection within an in-place cell editor (only if the rich content formatting functionality is enabled in the Spreadsheet/Report Designer control).

Pressing the Ctrl+2 or Ctrl+B key combination reproduces the ToggleFontBold command’s effect.

Ctrl+3 / Ctrl+I

Adds/removes the Italic attribute to/from the current font used to display:

  • The values in all selected cells;

  • The text selection within an in-place cell editor (only if the rich content formatting functionality is enabled in the Spreadsheet/Report Designer control).

Pressing the Ctrl+3 or Ctrl+I key combination reproduces the ToggleFontItalic command’s effect.

Ctrl+4 / Ctrl+U

Adds/removes the Underline attribute to/from the current font used to display:

  • The values in all selected cells;

  • The text selection within an in-place cell editor (only if the rich content formatting functionality is enabled in the Spreadsheet/Report Designer control).

Pressing the Ctrl+4 or Ctrl+U key combination reproduces the ToggleFontUnderline command’s effect.

Ctrl+5

Adds/removes the Strikeout attribute to/from the current font used to display:

  • The values in all selected cells;

  • The text selection within an in-place cell editor (only if the rich content formatting functionality is enabled in the Spreadsheet/Report Designer control.

Pressing the Ctrl+5 key combination reproduces the ToggleFontStrikeout command’s effect.

Ctrl+9

Hides all rows that intersect the current cell selection area.

The Ctrl+9 key combination duplicates the HideRows command’s effect.

Ctrl+0

Hides all columns that intersect the current cell selection area.

The Ctrl+0 key combination duplicates the HideColumns command’s effect.

Ctrl+A / Ctrl+Shift+Spacebar

Selects all cells within the active worksheet in one or two steps. If the cell focus is located within the cell region that contains data, pressing the Ctrl+A key combination for the first time selects only this cell range. Pressing Ctrl+A for the second time selects all cells within the worksheet.

If the active worksheet either contains no data or the cell focus is not within the cell region that stores data, pressing the Ctrl+A key combination selects all cells within the worksheet immediately.

Unlike Ctrl+A, the Ctrl+Shift+Spacebar key combination always selects all cells within the active worksheet.

Ctrl+Arrow Keys

Moves focus to the nearest cell object within the current row or column (i.e., the Ctrl+Left, Ctrl+Up, Ctrl+Right, or Ctrl+Down key combination moves focus to the nearest cell object located to the left, above, to the right, and below the currently focused cell). If there are no cell objects on the supposed path of the cell focus, it is moved to the last cell on the respective worksheet’s edge (i.e., left, top, right, or bottom, depending on a specific arrow key pressed).

If a floating container is selected, this key combination moves it by one pixel in the respective direction, identical to the arrow keys pressed without Ctrl.

Ctrl+C / Ctrl+Insert

Copies the current cell selection to the clipboard. If the active worksheet has more than one selected cell range, pressing the Ctrl+C or Ctrl+Insert raises the EdxSpreadSheetError exception. While the clipboard stores the cell data, the dashed line bounds the copied cell range. Like in Microsoft Excel®, you can clear the clipboard by pressing Esc.

A focused floating container. These key combinations copy it to the clipboard. The picture, shape, text box, or comment container can then be pasted from the clipboard to a worksheet.

Reproduces the CopySelection command’s effect.

Ctrl+D

Populates the currently selected cell range with both the contents and style of its topmost cell (if the range’s width does not exceed a single cell) or row.

Ctrl+End

Cancels the current cell selection and moves cell focus to the bottom-right corner of the Dimensions area. Previous cell focus position is irrelevant.

If there are no cell objects within the active worksheet, pressing this key combination moves cell focus to the topmost cell in the worksheet’s first column.

Ctrl+Equals Sign(=)

Applies/removes the Subscript attribute to/from the current font or text selection in an in-place cell editor. Applying the Subscript font attribute replaces Superscript. Press the Ctrl+Shift+Equals Sign(=) key combination to apply/remove the Superscript font attribute instead.

Ctrl+F

Invokes the Find and Replace dialog with the activated Find tab.

Pressing the Ctrl+F key combination reproduces the FindAndReplace command’s effect.

Ctrl+F3

Invokes the “Name Manager“ dialog. The Ctrl+F3 keystroke reproduces the ShowDefinedNameManager command’s effect.

Ctrl+H

Invokes the Find and Replace dialog with the activated Replace tab.

Ctrl+Home

Cancels the current cell selection and moves the cell focus to the upper-left (origin) cell of the active worksheet.

Ctrl+K

Displays the Insert Hyperlink dialog for new hyperlinks or the Edit Hyperlink dialog for a previously created hyperlink. You can add hyperlinks to both the cells and floating containers, including comments.

Pressing the Ctrl+K key combination reproduces the ShowHyperlinkEditor command’s effect.

Ctrl+PgDn

Switches between the currently visible worksheets, consecutively activating their respective tabs from left to right in the caption bar. If the rightmost worksheet tab is already active, pressing this key combination has no effect. The Ctrl+Page Up key combination consecutively activates the currently visible worksheets in reverse.

Ctrl+PgUp

Switches between the currently visible worksheets, consecutively activating their respective tabs from right to left in the caption bar. If the leftmost worksheet tab is already active, pressing this key combination has no effect. The Ctrl+Page Down key combination consecutively activates the currently visible worksheets in reverse.

Ctrl+R

Populates the currently selected cell range with both the contents and style of its leftmost cell (if the range’s height does not exceed a single cell) or column.

Ctrl+Shift+&

Applies the outline border to the currently focused cell or selected cell range(s). This key combination is a direct counterpart of the Ctrl+Shift+_ key combination.

Ctrl+Shift+_

Returns the outline border of the currently focused cell or a selected cell range to its original state. This key combination is a direct counterpart of the Ctrl+Shift+& key combination.

Ctrl+Shift+~

Applies the General number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+$ / Ctrl+Shift+4

Applies the Currency number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+% / Ctrl+Shift+5

Applies the Percentage number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+^ / Ctrl+Shift+6

Applies the Scientific number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+# / Ctrl+Shift+3

Applies the Date number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+@ / Ctrl+Shift+2

Applies the Time number format to data within the currently focused cell or selected cell range(s).

Ctrl+Shift+! / Ctrl+Shift+1

Applies the Number format (that has two decimal places, thousands separator, and minus sign (-) for negative values) to the data within the currently focused cell or selected cell ranges.

Ctrl+Shift+*

Selects the current region around the focused cell (the area enclosed by blank rows and columns containing uninitialized cells).

Ctrl+Shift+:

Enters the current time into the focused cell.

Ctrl+Shift+”

Copies the value to the currently focused cell from the adjacent cell above.

Ctrl+Shift+End

Extends the selected cell range to the bottom-right corner of the Dimensions area, i.e., to the cell object with the largest row and column index values.

Ctrl+Shift+Enter

Accepts the changes made in an in-place cell editor and closes it, leaving the current cell focused. If an in-place editor was used to enter a formula expression, this key combination chooses the array formula variant of the function, if applicable.

Ctrl+Shift+Equals Sign(=)

Applies/removes the Superscript attribute to/from the current font or text selection in an in-place cell editor. Applying the Superscript font attribute replaces Subscript. Press the Ctrl+Equals Sign (=) key combination to apply/remove the Subscript font attribute instead.

Ctrl+Shift+Home

Extends the selected cell range to the active worksheet’s upper-left cell.

Ctrl+Shift+Minus Sign(-)

Displays the Delete dialog for deleting cells, rows, and columns at the currently focused cell or selected cell range.

Ctrl+Shift+O

Selects all cell objects that have an associated comment container in the currently active Table View worksheet.

Ctrl+Shift+P

Displays the Format Cells dialog with the active Font tab for the currently focused cell or selected cell range.

Ctrl+Shift+Plus Sign(+)

Displays the Insert dialog for inserting cells, rows, and columns at the currently focused cell or selected cell range.

Ctrl+Spacebar

Selects an entire column whose cell object is currently focused.

This key combination works even if there are no cell or column objects created within the active worksheet.

Ctrl+V / Shift+Insert

Pastes the current clipboard content into the active worksheet. If the clipboard contains:

  • A bitmap image. Pasting an image creates a new rectangle-shaped picture container within the active worksheet.

  • A single cell object‘s value. The Spreadsheet control populates the currently focused cell or selected cell range(s) with both the cell value and style from the clipboard.

  • A cell range. The Spreadsheet control populates the identical area within the active Table View worksheet starting from the currently focused cell or selected cell range’s upper-left corner. If there are multiple selected cell ranges and at least one of them is not identical in size to the pasted cell range, the EdxSpreadSheetError exception is raised.

  • A floating container. The picture, shape, or text box container, previously copied or cut to clipboard, is pasted to the currently active sheet into the topmost container layer, matching its upper-left corner with the upper-left corner of the currently focused cell. The pasted comment container is associated with the focused cell. If no cell is focused, the pasted comment is attached to the previously focused cell in the same worksheet.

Pressing the Ctrl+V or Shift+Insert key combination reproduces the effect of the PasteSelection command.

Ctrl+X / Shift+Del

Pressing this key combination results in moving (cutting) to the clipboard both the cell data and associated styles from the currently focused cell or a selected cell range. If there are more than one selected cell ranges in the active worksheet, the EdxSpreadSheetError exception is raised.

The clipboard contents can then be used for pasting into one or more different cells or cell ranges. Until the cut content is pasted into a destination cell/cell range, it is still displayed in its original location bound by the dashed rectangle. Unlike the copying operation, the cut cell content is removed from the clipboard immediately after pasting. Note that the content of the locked cell objects in a protected worksheet cannot be moved (cut) to the clipboard.

If a floating container is selected, pressing this key combination results in moving this picture, shape, text box, or comment container to the clipboard for further pasting, either to the same or any other Table View worksheet. The clipboard behavior is identical to the cell data case.

Pressing the Ctrl+X or Shift+Del key combination reproduces the effect of the CutSelection command.

Ctrl+Y

Restores the effects of the last of the previously undone actions by invoking the Redo procedure with the default parameter. Pressing the Ctrl+Y key combination is equivalent to executing the Redo command. If the history functionality is not enabled in the Spreadsheet control by setting its OptionsBehavior.History property to True, pressing this key combination has no effect.

To undo the last action performed within the currently opened spreadsheet document, press the Ctrl+Z or Alt+Backspace key combination.

Shift+Arrow Keys

This key combination expands the currently selected cell range by one cell, row, or column depending on the area’s shape and the actual arrow key pressed. If there are several selected cell ranges within the active worksheet, this key combination expands only the last selected cell or cell range.

If a floating container is selected (focused):

  • The Shift+Up and Shift+Down key combinations decrease and increase the container’s height without moving its center, respectively;

  • The Shift+Left and Shift+Right key combinations decrease and increase the width of the focused container, respectively.

Shift+F2

Invokes the Customize Object dialog with the active Text tab for a comment container associated with the currently focused cell. If the focused cell is not commented, the Shift+F2 key combination creates a new comment container.

The Shift+F2 key combination corresponds to the EditComment command.

Shift+F3

Invokes the “Insert Function” dialog for the focused cell if the Formula Bar control is associated with the Spreadsheet or Report Designer control.

Alternatively, end-users can click the “Insert Function” button on the Formula Bar control.

Shift+F11

Inserts a new Table View worksheet into the spreadsheet document, generates the worksheet’s name and makes this worksheet active. The caption bar displays the new worksheet tab to the left of the previously active worksheet tab.

The Shift+F11 key combination corresponds to the InsertSheet command.

Shift+Spacebar

Selects the entire row that intersects the cell selection in which the cell focus is currently located.

See Also