Microsoft KB Archive/188503

= XL97: Overlapping Formatted Cell Border Behavior =

Article ID: 188503

Article Last Modified on 8/17/2005

-

APPLIES TO


 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 95 Standard Edition
 * Microsoft Excel 5.0 Standard Edition

-



This article was previously published under Q188503





SUMMARY
When the formatted borders of cells are adjacent, you may observe different behavior based on which version of Microsoft Excel you are using. This article discusses the different behaviors that you may observe.



MORE INFORMATION
When you format cell borders in Microsoft Excel and the borders are adjacent, the version of Excel determines what kind of behavior you observe.

For Microsoft Excel 97, the most recently applied style or color border format takes precedent. For example, if you select cell B5 and apply the solid thick border format with the color black, and then you select cell B6 and apply the solid thin border format with the color yellow, the adjacent border format between cells B5 and B6 will be thin and yellow. If you then select cell B5 and re-apply the solid thick border format with the color black, the adjacent border format between cells B5 and B6 will be the solid thick black format because this format is now the last border format you applied.

To illustrate this behavior, do the following:


 * 1) From Excel 97, in a new workbook, select cell B5.
 * 2) On the Format menu, click Cells to display the Format Cells dialog box. Click the Border tab.
 * 3) In the Style group, select the solid, thick border format located just above the double line in the right column of border styles with the color black. Click Outline, and then click OK.

Cell B5 should now have a thick, black border.
 * 1) Select cell B6 and on the Format menu, click Cells to open the Format Cells dialog box. Click the Border tab.
 * 2) In the Style group, select the solid thin border format located at the bottom of the left column of border styles with the color yellow. Click Outline, and then click OK.

Cell B6 should now have a thin, yellow border. The adjacent cell edge between cells B5 and B6 should now be thin and yellow.

To give border precedence back to cell B5, do the following:


 * 1) Select cell B5. On the Format menu, click Cells to open the Format Cells dialog box. Click the Border tab.
 * 2) In the Style group, select the solid thick border format from the right column of border styles just above the double line with the color black. Click Outline, and then click OK.

The adjacent cell border between cells B5 and B6 should now be solid, thick, and black.

Microsoft Excel 7.0 and earlier have the following cell border precedence:   Style         Weight    Strength =====        ======    ========

Double       Thin          7 Solid        Thick         6 Solid        Medium        5 Solid        Thin          4 Dash         Thin          3 Dot          Thin          2 Solid        Hairline      1 The following list shows the color precedence for Excel 7.0 and 5.0, from greater to lesser precedence:

Dark Blue

Blue

Dark Red

Purple

Red

Dark Green

Magenta

Dark Cyan

Light Brown

Green

Cyan

Yellow

Darker colors typically get precedence over lighter colors and style border format has precedence over color border format.

For example, if you select cell B5 and apply the solid thick border format with the color yellow, and then you select cell B6 and apply the solid thin border with the color black, the adjacent border format between cells B5 and B6 will be thick and yellow because the solid thick border format has greater precedence even though the color yellow has lesser precedence. Color precedence will only be a factor when the style border formats of the adjacent cells are the same.

To illustrate border precedence order, do the following:


 * 1) In a new workbook from Excel 7.0 or 5.0, select cell B5.
 * 2) On the Format menu, click Cells to activate the Format Cells dialog box.
 * 3) Click the Border tab to display the Border sheet.
 * 4) In the Style group, select the solid thick border format located at the bottom of the left column with the color black. Click Outline, and then click OK.

Cell B5 should now have a thick, black border.
 * 1) Select cell B6 and on the Format menu, click Cells to activate the Format Cells dialog box.
 * 2) On the Border sheet in the Style group, select the solid thin border format located at the top of the left column with the color yellow. Click Outline, and then click OK.

Cell B6 should now have a thin, yellow border but the adjacent cell edge between cells B5 and B6 is still thick and black because the solid thick border has precedence over the solid thin border.

To illustrate color precedence order, do the following:


 * 1) In a new workbook from Excel 7.0 or 5.0, select cell B5.
 * 2) On the Format menu, click Cells to open the Format Cells dialog box.
 * 3) Click the Border tab to display the Border sheet.
 * 4) In the Style group, select the solid thick border format located at the bottom of the left column with the color yellow. Click Outline, and then click OK.

Cell B5 should now have a thick, yellow border.
 * 1) Select cell B6 and on the Format menu, click Cells to open the Format Cells dialog box.
 * 2) On the Border sheet, in the Style group, select the same border format from step 4, except with the color black. Click Outline, and then click OK.

Cell B6 should have a thick, black border and the adjacent cell edge between cells B5 and B6 should now be thick and black because the color black has precedence over the color yellow.

