Automatically apply styles in excel. How to Use Named Styles in Excel

Styles in Excel is a tool that allows you to significantly simplify and speed up the process of formatting a document. Formatting styles can be defined as being stored under a specific format preset name. They can be easily assigned to one or many cells.

Assigning formatting styles to cells

Each style has the following settings:

  1. Font (type, size, color, etc.).
  2. Number display format.
  3. Cell borders.
  4. Fill and patterns.
  5. Cell protection.

Thanks to styles, all sheets are easy and quick to format. And if we make a change to the style, then these changes are automatically assigned to all the sheets that are formatted by them.

Excel provides a library of ready-made thematic styles, as well as the ability to create your own custom styles.

To use the built-in styles library, you must:



Creating a custom style from a sample

Now let's create our own custom style, but following the model of the already finished one:


Thus, based on the inline style, we created a duplicate, which we changed to fit our needs.

Is it possible to change the style in Excel? In principle, it was possible not to create a duplicate, but in context menu select "Change" immediately. Any changes to any default inline style would only be saved in the current workbook. They do not affect the program settings. And when creating a new book, the style library is displayed as standard without any changes.

Is it possible to delete a style in Excel? Of course you can, but only within the framework of one book. For example, how to remove custom styles in Excel?

Select the desired style in the main panel: "Cell Styles" and in the "Custom" section, right-click. From the context menu that appears, select the "Delete" option. As a result, the cells will be cleared of the formats specified by the corresponding style.

In the same way, you can remove the styles in Excel that are built-in by default in the library, but this change will only apply to the current workbook.

Create style by cell format

But what if you want to create a style based on a custom cell format that is defined in the usual way.

  1. Set the empty cell format with changing the fill and font color.
  2. Now select this original cell and select the tool from the main panel: "Cell Styles" - "Create Cell Style".
  3. In the "Style" window, name the style "As in cell1" and click OK.

Now you have the name "As in cell1" in the "Custom" style section. The principle is clear.

All of the above described style formats are saved within the file of the current Excel workbook. Therefore, save this workbook as Style Lesson.xlsx for later.

Copying a Style to Other Books

Sometimes it becomes necessary to use the current styles in other books. To do this, you can simply copy them:

  1. Create new book, in which we will use the custom style "As in cell1".
  2. Open the book "Style Lesson.xlsx" from the saved original style we need.
  3. Select the tool on the main tab: "Cell Styles" - "Combine". And in the "Combining Styles" window, point to the book we need and OK.

Now all custom or modified formats from the original workbook are copied to the current workbook.

If you need to use the same style often in different books, then it makes sense to create a special book with your own styles and save it as a template. It will be much more convenient than copying each time ... And we will take a closer look at all the advantages of templates in the next lessons.

Formatting in Excel is a very tedious but important task. With styles, we can significantly speed up and simplify this workflow. While maintaining exact copy cell formats in different sheets and workbooks.

The idea behind named styles is as follows:

  1. You can create your own style set for formatting such as headings, footers, plain text. And then apply ready-made styles to other cells without wasting time reproducing exactly the same format.
  2. If you change the style format, then all cells to which this style is applied will be automatically formatted. Thus, you can quickly review any format and do not waste time formatting cells individually.

Excel styles allow you to format the following attributes:

  • number format (for example, number, short date format, format telephone number etc.);
  • alignment (vertically and horizontally);
  • font (name, size, color, etc.);
  • border (line type, border color);
  • fill (background color, pattern);
  • protection (protected cell, hiding formulas).

Applying styles to worksheet cells

Excel comes preinstalled with many built-in styles. You can find them on the menu. Cell styles located on the tab home-> Styles.

The style gallery will open (picture on the right).

To apply a style to a selected cell or range, left-click on the desired style. There is also a very handy preview feature: when you hover over the style, you will see how the style of the cell changes.

After applying the style from the gallery, you can apply additional formatting to the cells.

Creating New Styles

If Excel's built-in styles aren't enough, you can create your own styles. This is easy enough to do:


As a result, a new custom style will be added to the active book, which will be available in the menu Cell styles.

Changing Existing Styles

You can change the formatting of an existing style. In this case, all cells to which this style is applied will also change the formatting. To change the style you need:

  1. Go to tab home-> Cell styles.
  2. Right-click on the style you want to change and select command Change.
  3. A dialog box will open Style A that specifies the formatting to apply to the cell.
  4. Click on the button Format, and in the dialog box that appears Cell Format set the required formatting. For example, to change the font size, go to the tab Font, set the desired size and click the button OK.
  5. Press the button again OK to close the window Style and apply formatting to the editable style.

Transferring Styles to Another Book

Unfortunately, the styles are applied to the current workbook. Those. if you open a new workbook, it will not contain the new styles that were previously created. In order not to re-create styles, there is a style merging tool. For this you need:

  1. Open a workbook that already contains the new styles. And open the file where you want to transfer these styles.
  2. Navigate to the book that contains the new styles and open the styles menu home-> Cell styles.
  3. Choose a team Merge, a dialog box will open. Combining Styles.
  4. This window contains a list of all open books. Select the book to which you want to copy the styles and click the button OK.

A cell style is a set of formatting options such as fonts and font sizes, number formats, borders, and cell shading. To prevent other users from changing specific cells, you can also use a cell-blocking style. includes several built-in cell styles that you can apply or customize. You can also change or duplicate the cell style to create your own custom style.

Cell styles are based on the document theme applied to the entire worksheet. When you select a different theme, the cell styles change accordingly.

You can use a cell style to apply multiple formats at the same time and still keep cell formats consistent. There are several built-in cell styles that you can apply and modify. You can also create custom cell styles by modifying or copying a style. Cell styles are based on the document theme, which applies to the entire workbook. When you switch to a different document theme, the cell style changes to match the theme.

How to apply cell style?

  • In the open sheet window, select the desired cells.
  • Go to the Home tab and in the Styles group, expand the Cell Styles button menu.
  • In the style list, click the icon desired style(Fig. 3.59).

For many years, one of the most underutilized features of Excel has been named styles. Looks like the Excel designers have made this feature more visible now. Starting with Excel 2007 gallery Styles hard to miss (it's on the tab home).

Named styles essentially circumvent the application of a set of predefined formatting options to a cell or range of cells. In addition to saving time, using named styles helps ensure a consistent look across all your sheets.

A style can consist of parameters, including up to six different attributes (which correspond to the tabs in the window Cell Format):

  • number;
  • alignment (vertically and horizontally);
  • font (type, size and color);
  • the border;
  • fill (background color);
  • protection (blocking and hiding).

The real power of styles comes from changing the components of a style. All cells that implement a particular named style will automatically accept the changes. Let's say you've applied a custom style to dozens of cells scattered throughout the sheet. Later, you realized that they should all have a 14th font size, not a 12th. Instead of changing the font for each cell, just change the style definition. All cells to which this special style applies will automatically accept the style changes.

Using the Style Gallery

Excel comes with dozens of pre-made styles and you can apply them using the gallery Styles(located in the group Home Styles). On fig. Figure 67.1 shows the predefined styles in the style gallery.

To apply a style to a selected cell or range of cells, simply click on the style. Please note that this gallery provides preview. When you hover over the style, it is temporarily applied to the current selection and you can see the effect. To make it permanent, just click on the style.

After you apply a style to a cell, you can set additional formatting for it using any of the methods discussed in the section. These changes made to a cell will not affect other cells that use the same style. To increase the value of styles, it's best to avoid extra formatting. Rather, it is worth considering creating a new style (I will talk about this a little later).

Changing an existing style

To change an existing style, open the gallery Styles, right-click the style you want to change, and choose Edit from the shortcut menu. The Style window shown in Fig. 67.2. In this example, the dialog box Style shows the settings for the style Ordinary, which is the default for all cells (style definitions may vary depending on which document theme is active).

By default, cells use the style Ordinary. Consider quick example how styles can be used to change the default font set throughout your book.

  1. Select Home Styles Cell styles. Excel will display the style list for the active workbook.
  2. Right click on style Ordinary and select command Change. A window will appear on the screen. Style with current settings for style Ordinary.
  3. Click the button Format. A window will open Cell Format.
  4. Go to the tab Font and select the font and size you want to use as default.
  5. Click the button OK to return to the dialog Style.
  6. Click again OK to close the dialog Style.

Font for all cells that use the style Ordinary, will change to the one you specified. You can change any of the formatting attributes for any style.

Creating New Styles

In addition to using Excel's built-in styles, you can create your own styles. This flexibility can be very handy because it allows you to apply your preferred formatting options quickly and consistently. To create new style, do the following.

  1. Select the cell and apply any formatting options you want to include in the new style. You can use any formatting available in the dialog Cell Format.
  2. After formatting the cell to your liking, open the gallery Styles and select command Create cell style. A window will appear on the screen. Style, and the program will suggest a common name for the style. Pay attention to what is written (according to the example). This tells Excel to base the style on the current cell.
  3. Enter the name of the new style in the field Style name. The checkboxes display the current formats for the cell. By default they are all selected.
  4. If you do not want the style to include one or more format categories, clear the appropriate check boxes.
  5. Click OK to create a style and close the dialog box.

After completing these steps, the new custom style will be available in the gallery Styles. Custom styles are only available in the workbook in which they were created. Read on for information on how to copy them.

Checkbox sewn into the window Style controls whether users can edit cells for the selected style. This checkbox is only active if you have enabled sheet protection by selecting File Details Protect Workbook.

Merging styles from different books

It is important to understand that custom styles are stored with the workbook in which they were created. But if you've created multiple custom styles, you probably don't want to go through the same steps again, making copies of the styles in each new one. Excel workbook. The best approach is to merge styles from the books in which they were previously created.

To copy styles from another book, open both the book containing the styles you want to merge and the one in which you want to use them as well. In the second book, open the gallery Styles and choose Merge Styles. A window will appear on the screen. Combining Styles, which shows a list of all open workbooks. Select the book containing the styles you want to merge and click OK. Excel will copy the styles from the workbook you selected to the active workbook.

You may want to create a custom book containing all the styles. In this case, you will always know which book to copy the styles from.

If to format the cells of the sheets of their spreadsheets If you use the same settings all the time, it makes sense to create a formatting style (a set of formatting attributes) that you can save with your workbook and use when you need those same attributes to format your data. After creating a new or modifying an existing formatting style, this style can be used on any sheet of the book, in addition, this style can be copied to others. open books. Microsoft Excel makes it easy to do the following:

Create your own styles

Use Existing Styles

Copy or merge styles from different books

Delete custom styles

Creating Your Own Styles

There are several ways to create your own styles using the Style dialog box (Format menu, Styles command).

The easiest way to create a new style is based on the cells whose formatting options you want to assign to the style you are creating. This is called creating a style by example because it uses the sheet's own formatting to define the style.

If the cells were not formatted before the style was created, the Style Name field will display the "Normal" style. In Microsoft Excel, in addition to the "Normal" style, several more styles are predefined, including the "Financial", "Money" and "Percentage" styles. Any of these styles (as well as any of your own styles) can be changed.

Create a new style based on an existing format

In the Style name field, enter a name for the new style.

Creating a style from scratch

On the Format menu, choose Style.

Enter a name for the new style in the Style Name field.

Click the Edit button.

In the Style Includes group, specify the desired style attributes.

Changing an existing style

On the Format menu, choose Style.

Click the Edit button.

Change the style using the tabs in the Format Cells dialog box.

Click OK twice.

Note. The changed style will be updated throughout the book.

Using Existing Styles

An existing style, either predefined or created, can be quickly used in your book. Standard styles such as Fiscal, Monetary, and Percentage are also easily accessible from the Formatting toolbar. Other styles can be used using the Style command on the Format menu.

Applying a style

Select the cell or range of cells to which you want to apply the desired style.

On the Format menu, choose Style.

In the Style Name drop-down list, click the style to apply.

In the Style Includes group, select all style categories to apply.

Including styles from other books

The created new style can only be used in the book where it was created - the new style is saved in the current book and is not available in other books. (That way, the styles for your stock portfolio won't get confused with your colleague's expense budget styles.) But you can copy or include styles from other books in the current workbook.

The join is powerful, but should be used with some care. If the book in which the styles are included has styles with the same name, the existing styles can be replaced with new ones that will be applied throughout the book.

Including Styles from Other Microsoft Excel Workbooks

Open the source book (the book to copy the styles from) and the destination book (the book to copy the styles to).

Make the end book active.

On the Format menu, choose Style.

Click the Merge button.

In the Merge Styles From box, select the name of the book you want to copy the styles from (the source book), and then click OK.

Microsoft Excel copies all styles from the source workbook to the destination workbook. If the source workbook contains formatting styles that have the same name as styles that exist in the target workbook, a warning will appear asking if you want to include styles with the same name. If you click Yes, the styles will be merged and the styles of the source book will be applied throughout the current book.

Note. The Undo command will not be able to undo the merging effect. Make sure you want to copy all of these styles from the source book to the destination book. You may also want to remove any unwanted styles before starting the merge.

Deleting User Styles

Unnecessary user style can always be deleted. You cannot delete the "Normal" style. Also, if you remove the Money, Money, or Percentage style, you will no longer be able to use the Money, Money, or Percentage style buttons on the Formatting toolbar.

Deleting a Style

On the Format menu, choose Style.

In the Style Name drop-down list, select the custom style you want to delete, and then click the Delete button.

Internet