Styles

A style is a group of commands that change the appearance of the cells in your worksheet.
A style lets you apply a name to a combination of formatting attributes and are workbook specific.
You can use styles to help your worksheets and workbooks contain consistent formatting.
If you consistently apply specific formatting options you can create a named style so that you can apply this style quickly.
These attributes can then be quickly applied by selecting the name of the style from a list.
Styles are useful when you want all the headings in your workbook to look the same. If you change the style of one, then they will all change.


 

It is very easy to mistake the styles for something else though, either number formats or table styles.


Styles are not suitable for ranges of cells with different outline borders.


Advantages of using Styles

Styles can save you a lot of time when you need to apply the same format to different parts of your worksheet.
The advantage of using styles is that you can apply more than one formatting enhancement to a range of cells in one go.
One advantage is that you can update them easily at a later date.
Styles are not suitable for ranges of cells with different outline borders.


Built-in Styles

Every new workbook contains 6 built-in pre-defined styles
Comma - Two decimal places and a thousand separator (number formatting only)
Comma [0] - Same as above, rounded to the nearest integer
Currency - Currency format with two decimal places, thousand separator and currency sign (number format attribute only).
Currency [0] - Same as above, rounded to the nearest integer
Normal - Includes defaults for all formatting attributes
Percent - Percentage format with no decimal places (number formatting attribute only).
Note: If your workbook contains hyperlinks, then there may be extra styles "Hyperlink" and "Hyperlink Active"


In Styles there is an option to specify a style for the text after your style (example in the case of a caption with a (1x1) table below it


Default Style

The default style is called "Normal" and this is used for both text and numbers and is also used to determine the font used for the row and column headings.
This can be changed from the (Tools > Options)(General tab) for new workbooks. The default font is Arial, 10
For existing workbooks it can be changed from the (Format > Style > Normal > Modify) dialog box.


 

Any changes you make to the default font will not take affect untill Excel is closed and reopened.
Changing the Normal style of a workbook will only affect the font in that particular workbook.



Creating Styles

You can easily create new styles. To create a style that flashes cells red and white. (Format > Styles) (Type Flash and Add). Add the following code to a module and run the procedure Flash from Auto_Open.
This can be done in two ways.
1) Providing an example of the style in a cell on a worksheet. Select the individual cell and select (Format > Styles). Select Add and type in the name.
2) Defining the attributes in the (Format > Styles) dialog box. When you select the modify button the (Format > Calls) dialog box will be displayed, allowing you to change the attributes.
Select (Format > Style) and type the name of the new style in the Style name field.
Tick the checkboxes for the elements you want to change or define and click the Modify button.
Once you have changed the formatting click the Add button and then press OK.


Styles have 6 attributes and these correspond to the six tabs of the (Format > Cells) dialog box.


 


Modifying Styles

Click Modify to modify the currently selected style



Removing Styles

Select the style you want to delete from the drop-down and press the Delete button.
Any cells that are formatted with a style that is deleted are changed back to the "Normal" style.
Any cells that were formatted with that style but have since had some additional formatting added to them will remain the same.


Merging Styles

You can copy your styles to different workbooks ??
SS Merge dialog box
It is possible to copy styles between workbooks.
Open both the workbooks and activate the destination workbook. Select (Format > Styles) and select the Merge button.
This dialog box will display a list of all open workbooks. Select the name of the workbook you want to copy the styles from and press OK.
Be aware that any styles with the same name will be overwritten. You will only receive a single prompt regardless of how many styles may be overwritten.
When you merge cell styles (ie copy them from one workbook to another) another dialog box will appear giving you a list of all the open workbooks.
If a style in the source workbook has the same name as one that already exists in your destination workbook you will be notified with the following prompt.
SS
You will only receive this notification once for the first style and not for any subsequent duplicates.
If you choose Yes all the styles in the destination workbook are overwritten with the styles in the source workbook.


Style Drop-Down List

In Excel 2003 accessing your styles was not particularly easy or convenient.
If you use styles a lot you might want to consider adding the "Default Style" button to one of your toolbars ??
If you are using a lot of styles in your workbook, then it may be worth adding the Style drop-down list to the Formatting toolbar.
For more details on this see the Customising your Toolbars and Menus section [Link]. This will also enable to create a new style by selecting the cell and typing the new name directly into the drop-down box.
SS - added to formatting toolbar.


Important

All the pre-defined styles except Normal only have a number attribute defined.
You can quickly change the formatting attributes of all the cells within a workbook by changing any of the "Normal" attributes.
Try to keep your style names short and use names that describe how the style is used and not the attributes.
It is always a good idea to remove any unwanted styles.
The standard Excel font and size is Arial 10. I personally would not change this. If you copy data (i.e. charts or objects) between workbooks that have different fonts and sizes it will create problems !!
You cant change a style in any worksheets in a workbook that is protected.


© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Top

PrevNext