excel工资表标题行重复
A few weeks ago we looked at a way to fill blank cells in an Excel report, so you'd be able to filter or sort a table of data. The downside of that technique is that it's harder to pick out the sections in a report. The headings don't pop off the page -- they're buried in a long list of items.
几周前,我们研究了一种在Excel报表中填充空白单元格的方法,因此您可以对数据表进行过滤或排序。 该技术的缺点在于,很难在报告中挑选出各个部分。 标题不会从页面上弹出-它们埋在一长串的项目中。
You can have the best of both worlds, if you fill in all the blanks, then hide the duplicate items with conditional formatting. This technique works best when the column is sorted, so duplicate headings are listed together.
如果您填写所有空白,然后使用条件格式隐藏重复的项目,则可以两全其美。 当对列进行排序时,此技术最有效,因此重复的标题会一起列出。
隐藏重复的标题 (Hide the Duplicate Headings)
In this table, the January items are listed, then February, and each row has the month name filled in. If the list is long, it can be hard to see exactly where each month's items start.
在此表中,列出了一月的项目,然后是二月,并且每行都填写了月份名称。如果列表很长,则很难确切看到每个月的项目从何处开始。
To hide the headings, you can add conditional formatting to the cells with month names in column D.
要隐藏标题,您可以向D列中具有月份名称的单元格添加条件格式。
在Excel 2007中隐藏重复项 (Hide Duplicates in Excel 2007)
- Select all the cells with month names, cells D2:D13 in this example. 选择所有具有月份名称的单元格,在此示例中为单元格D2:D13。
On the Ribbon, click the Home tab, then click Conditional Formatting
在功能区上,单击“主页”选项卡,然后单击“条件格式”
Click Use a Formula to Determine Which Cells to Format
单击“ 使用公式来确定要格式化的单元格”
In the Edit the Rule section, enter a formula that refers to the active cell, and the cell above it. In this example, D2 is the active cell:
在“编辑规则”部分中,输入引用活动单元格及其上方单元格的公式。 在此示例中,D2是活动单元:
=D2=D1
= D2 = D1
- Click the Format button, and click the Font tab. 单击格式按钮,然后单击字体选项卡。
- From the Color drop down, select a font colour to match the cell fill colour. In this example, the cell has no fill, so I'll select White as the font colour. 从“颜色”下拉列表中,选择一种字体颜色以匹配单元格填充颜色。 在此示例中,单元格没有填充,因此我将选择白色作为字体颜色。
- Click OK to close the Format Cells dialog box, then click OK to close the New Formatting Rule dialog box. 单击“确定”关闭“设置单元格格式”对话框,然后单击“确定”关闭“新建格式规则”对话框。
在Excel 2003中隐藏重复项 (Hide Duplicates in Excel 2003)
- Select all the cells with month names, cells D2:D13 in this example. 选择所有具有月份名称的单元格,在此示例中为单元格D2:D13。
- On the menu bar, click Format, then click Conditional Formatting 在菜单栏上,单击“格式”,然后单击“条件格式”
- From the first drop down, select Formula Is 在第一个下拉菜单中,选择公式为
In the Formula box, enter a formula that refers to the active cell, and the cell above it. In this example, D2 is the active cell:
在“公式”框中,输入引用活动单元格及其上方单元格的公式。 在此示例中,D2是活动单元:
=D2=D1
= D2 = D1
- Click the Format button, and click the Font tab. 单击格式按钮,然后单击字体选项卡。
- From the Color drop down, select a font colour to match the cell fill colour. In this example, the cell has no fill, so I'll select White as the font colour. 从“颜色”下拉列表中,选择一种字体颜色以匹配单元格填充颜色。 在此示例中,单元格没有填充,因此我将选择白色作为字体颜色。
- Click OK to close the Format Cells dialog box, then click OK to close the New Formatting Rule dialog box. 单击“确定”关闭“设置单元格格式”对话框,然后单击“确定”关闭“新建格式规则”对话框。
隐藏重复项 (The Duplicates Are Hidden)
After you apply the conditional formatting, the first instance of each heading is visible. Any duplicate headings immediately below it are hidden.
应用条件格式后,每个标题的第一个实例都是可见的。 隐藏在其下面的所有重复标题。
When cell D4 is selected, you can see January in the formula bar, but it's not visible in the cell, because the font is white.
选择单元格D4时,您可以在编辑栏中看到一月,但该单元格中的字体是白色的,因此在单元格中不可见。
观看视频 (Watch the Video)
To see the steps for hiding duplicate headings, watch this short video tutorial.
要查看隐藏重复标题的步骤,请观看此简短的视频教程。
翻译自: https://contexturesblog.com/archives/2009/09/30/hide-duplicate-headings-in-excel-report/
excel工资表标题行重复