Menu Information

Right-click Context Menu of the worksheet cell: Format Cells...

Brief Information

Format selected worksheet cells

Additional Information

It is not accessible from script.

Command Line Usage

1. wcellformat


With this X-Function, you can edit the formatting of cells. To use this X-Function, you can highlight one or more cells and then right-click and select "Format Cells..." from the short-cut menu. Or, you can type wcellformat in the Command Window to open the dialog.

Wcellformat help English files image002.jpg

The controls in this dialog:

Cell Range: This is an uneditable textbox that displays the cell range you have selected.

Rich Text: This checkbox is used to specify whether rich text formatting (for example, superscript and subscript) is enabled for the selected cells. Please note that when this checkbox is selected, the Wrap Text, Float and Flood check boxes will be automatically selected and you cannot clear these check boxes.

When this checkbox is unchecked, the format buttons Wcellformat help English files image004.jpgare gray. While if the Rich Text is checked, double-click in the specified cell to make it to the edit state and chose part of the cell contents, then you can see these buttons Wcellformat help English files image004.jpg are highlighted. You can set them as rich text.

Wcellformat help English files image006.jpg
Wcellformat help English files image008.jpg

Allow Enter: This checkbox allow Enter to be used in the specified cell. If it is checked, double-click in the specified cell to make it to the edit state and use Shift+Enter to separate the text into different rows.

Wrap Text: If the length of text exceeds the width of the cell, the text will be wrapped automatically to fit the cell width. If the Wrap Text checkbox is selected, Origin will not wrap in the middle of words. Otherwise, the words might be cut off in the middle due to the wrapping.

Wcellformat help English files image21.gif
Figure 1. Wrap Text is unchecked.
Wcellformat help English files image22.gif</center>
Figure 2. Wrap Text is checked.

Float: It allows text in this cell to overflow into the cell on its right. For example, suppose Float for Cell[1, 1] and Flood for Cell[1, 2] are both checked. When the length of the text in Cell[1, 1] is larger than the cell width and Cell[1, 2] is empty, the text in Cell[1, 1] will overflow into Cell [1, 2], as shown in the below screenshot.

Wcellformat help English files image23.gif
Figure 3. Float is checked.

Ellipsis: When text length exceeds cell width, you can opt to use floating or wrapping to proper display the text. However, if neither floating nor wrapping is used, ellipsis could be displayed to tell the user that the whole text cannot be fully shown.

Wcellformat help English files image24.gif

Merge: This option is used to merge adjacent cells that contain same text. Use this drop-down list, merge in horizontal, vertical or both.

Show Missing as Blank: In default setting, missing value in a cell is displayed as "--", use this check box, you can hide those "--", make cell contain missing value is empty.

Format: Use this drop-down list to select the formatting of the cell.

Display: Specify numeric data display form. This drop-down list provides 4 options for numeric data: Decimal: 1000; Scientific 1E3; Engineering: 1K; Decimal: 1,000. Function of them is same as options in column properties; the only difference is it control format for cell but not column.

Digits: Specify decimal number for numeric data. There are 3 options in drop-down list: Default Decimal Digits; Set Decimal Places = ; Significant Digits =

Significant Digits: This option is shown only when Digits is Significant Digits, it used to specify number of Significant Digits.

Decimal Number: This option is shown only when Digits is Set Decimal Places = , it used to specify number of decimal.

Apply Button: This button applies setting to selected cells but don't closed dialog.

OK Button: Apply setting to selected cells and Close dialog.

Cancel Button: Close dialog, Do nothing.


1. If Cell [1, 1] and Cell [1, 2] have same value, you want to merge them. Highlight them firstly, and open Format Cell dialog by short-cut menu. In dialog, set Merge as Horizontal.

2. Change one cell's value to Greek. Run wcellformat in command window to open dialog. Check the Rich Text checkbox and click OK button. Return to the specified cell, double-click in it and highlight the content. Then click the Greek button. You can change the cell value as Greek.

Related X-Functions