Microsoft Office Tutorials and References
In Depth Information
Creating Custom Cell Styles
A handful of additional formatting codes apply special treatment to text. Use an asterisk (*)
followed by a character to ill the cell with that character. Use *- in the third position of a
custom format to replace zero values with a line of hyphens, for example.
The underscore (_) followed by a character adds a space the width of that character. Several
built-in formats use this code with open and close parentheses to ensure that positive and
negative values line up properly.
Use a backslash (\) to display the character that immediately follows the backslash.
The at sign (@) is used only in the fourth (text) section in a custom format and controls the
formatting of any text you enter. If you include a text section without the @ character, Excel
hides any text in the cell.
You can also use conditions as part of custom number formats. Conditions use comparison
operators and are contained in brackets as part of a format definition. To see an example,
click the Special category, click the Phone Number format, and then click Custom to display
the following code:
[<=9999999]###-####;(###) ###-####
If you enter a number of seven or fewer digits in a cell that uses this format, Excel treats it
as a local phone number and adds a hyphen where the prefix appears. If you enter a
number with eight or more digits, the final seven digits are formatted as a local phone number,
and everything preceding that value is enclosed in parentheses.
Creating Custom Cell Styles
If you regularly apply special formatting to cells and ranges, you can avoid the need to
repeat the formatting steps by creating a custom cell style. Excel includes a categorized
selection of cell styles as part of a default installation, which you can view by clicking Cell
Styles on the Home tab to display the Cell Styles gallery. Any custom styles you create
appear in a new group at the top of the list, as shown next.
Search JabSto ::

Custom Search