How to use conditional formatting to automatically border cells in Excel

Source: Internet
Author: User
Tags first row

Excel has a number of "automatic" features, which can be more efficient if used properly. After the experiment, I found a way to use conditional formatting to automatically add borders to Excel cells, which is "the key, row is table." The following are the specific steps:

1. In the first row, select the area where you want to display the border, such as the a1:d1 in this example.

2. Perform "format" → "conditional formatting" to open the Conditional Formatting dialog box. Click to open the condition 1 drop-down list, click Select Formula, and then enter the following formula in the box below "=or ($A 1<>" ", $B 1<>" ", $C 1<>" ", $D 1<>" "), meaning that as long as A1, B1, C1 or D1 has data in one cell, the outer border is automatically added to these four cells.

Note: The cell reference in the formula is a mixed reference, and the effect is different if you change to a relative reference, and friends can try.

3. Click the Format button to open the Format Cells dialog box, switch to the Borders tab, and specify an outline for cells that match the criteria. As shown in Figure 1.

4. Select A1:d1 area, copy, select A→d column, paste (if you have entered data in A1:d1, perform "edit" → "paste Selective" → "format"), so that the format set in step 2nd is assigned to all cells in the A→d column. As shown in Figure 2.

Enter data (including spaces) in any of these four columns, and the cells in this row (a→d column) will automatically add a border. As shown in Figure 3.

Tip: For cells that have the border set for a conditional format, it still allows you to set its border in the Borders tab of the Cell Format dialog box, but the outline box cannot be displayed (as is the case with the Border button on the toolbar), only slashes are displayed unless you delete all the data in the criteria range.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.