Skip to main content
A newer version of this page is available. .

Cell Formatting

  • 3 minutes to read

The SpreadsheetControl allows end-users to apply different formatting options to worksheet cells, such as font attributes, alignment options and background color. You can enable end-users to change cell appearance using the Ribbon UI. For an example on how to provide a Ribbon UI for the SpreadsheetControl, see Getting Started. The table below lists the basic operations for cell formatting available to end-users via Ribbon tabbed pages (or the spreadsheet context menu) and the corresponding API methods and properties.

The SpreadsheetControl also provides the capability for end-users to use keyboard shortcuts to quickly apply formatting options. For details, refer to the Cell Formatting document.

Action

End-user capabilities

API methods/properties

Apply a built-in style

In the Styles group within the Home tab, select the style that you wish to apply to the selected cells.

CellStyles.png

Range.Style

How to: Apply a Style to a Cell or Range of Cells

How to: Create or Modify a Style

Specify cell font

  • Use the Font group within the Home tab to specify the font family, size, style, color, etc.

    FontGroup.png

  • Click the arrow in the bottom right corner of the Font group to invoke the Format Cells dialog with the Font tab opened.

    FontTab

Formatting.Font

How to: Change Cell Font and Background Color

How to: Configure Cell Font Settings

Specify alignment options

  • Use the Alignment group within the Home tab to position text within a cell.

    Alignment.png

  • Click the arrow in the bottom right corner of the Alignment group to invoke the Format Cells dialog with the Alignment tab opened.

    AlignmentTab

Formatting.Alignment

How to: Align Cell Content

Apply borders

  • In the Font group within the Home tab, click the Borders button’s drop-down menu and select the border type.

    Borders.png

  • Right-click a cell and select the Format Cells… item in the context menu. Click the Border tab of the invoked dialog and specify the borders.

    BorderTab

Formatting.Borders

How to: Add and Remove Cell Borders

Specify the background color

  • In the Font group within the Home tab, click the Fill Color button’s drop-down menu and select the desired color.

    FillColor.png

  • Right-click a cell and select the Format Cells… item in the context menu. Click the Fill tab of the invoked dialog and specify the color.

    FillTab

Formatting.Fill

How to: Change Cell Font and Background Color

How to: Apply Gradient Fill

Apply number formatting

  • Use the Number group within the Home tab to specify the number format.

    NumbersGroup.png

  • Right-click a cell and select the Format Cells… item in the context menu. Click the Number tab in the invoked dialog and specify the number format.

    NumberTab

Formatting.NumberFormat

How to: Specify Number or Date Format for Cell Content

Clear formatting

  • In the Editing group within the Home tab, click the Clear button, and select Clear formatting in the drop-down menu.

    ClearFormats.png

  • In the Styles group within the Home tab, select the Normal style, to restore the default settings.

Worksheet.ClearFormats

How to: Clear Cell Formatting