1. 程式人生 > 實用技巧 >如何在Excel中對工作表進行分組

如何在Excel中對工作表進行分組

The Microsoft Excel Logo.

If you’re editing multiple worksheets in Microsoft Excel, it might be helpful to group them together. This allows you to make changes to the same range of cells across multiple worksheets. Here’s how to do it.

如果要在Microsoft Excel中編輯多個工作表,將它們組合在一起可能會有所幫助。 這使您可以更改多個工作表中單元格的相同範圍。 這是操作方法。

在Microsoft Excel中對多個工作表進行分組 (
Grouping Multiple Worksheets in Microsoft Excel)

Grouping worksheets together in Excel can be useful if you have an Excel workbook with multiple sheets that contain different data but follow the same layout.

如果您有一個包含多個包含不同資料但遵循相同佈局的工作表的Excel工作簿,則在Excel中將工作表分組在一起將非常有用。

The example below shows this in action. Our Excel workbook, named “School Data,” contains multiple worksheets related to the operation of a school. Three of the worksheets have lists of students for different classes, named “Class A,” “Class B,” and “Class C.”

下面的示例顯示了這一點。 我們的Excel工作簿名為“學校資料”,其中包含與學校運營相關的多個工作表。 工作表中的三個包含不同班級的學生列表,分別稱為“ A級”,“ B級”和“ C級”。

An Excel workbook with similar worksheets of "Class A," Class B," and "Class C."

If we group these worksheets together, any actions we perform on any of these worksheets will be applied to all of them.

如果我們將這些工作表歸為一組,那麼我們在這些工作表上執行的任何操作都將應用於所有這些工作表。

For instance, say we want to insert an IF formula

in column G (cells G4 to G12) on each worksheet to determine whether any students were born in either 1998 or 1999. If we group the worksheets together before we insert the formula, we can apply it to the same range of cells on all three worksheets.

例如,假設我們要在每個工作表的G列(單元格G4至G12)中插入IF公式,以確定是否有任何學生出生於1998年或1999年。如果在將公式插入之前將工作表分組在一起,我們可以將其應用於所有三個工作表上的相同單元格區域。

To group worksheets together, press and hold the Ctrl key and click each worksheet you want to group together at the bottom of the Excel window.

要將工作表分組在一起,請按住Ctrl鍵,然後在Excel視窗的底部單擊要分組的每個工作表。

Three worksheets selected at the bottom of an Excel window.

Grouped worksheets appear with a white background, while unselected worksheets appear in gray.

分組的工作表顯示為白色背景,而未選擇的工作表顯示為灰色。

The example below shows the IF formula we suggested above inserted in the “Class B” worksheet. Thanks to worksheet grouping, the same formula was inserted in cells G4 to G12 on the “Class A” and “Class C” worksheets, too.

下面的示例顯示了我們在“ B類”工作表中插入的我們上面建議的IF公式。 由於工作表分組,相同的公式也插入到“ A類”和“ C類”工作表的單元格G4至G12中。

An Excel IF formula, applied to multiple grouped worksheets.

If we further modify any of these cells—like by adding a second set of formulas to column H—the change will be applied to all the grouped worksheets simultaneously.

如果我們進一步修改這些單元格中的任何一個(例如,通過在H列中新增第二組公式),則更改將同時應用於所有分組的工作表。

在Microsoft Excel中對所有工作表進行分組 (Grouping All Worksheets in Microsoft Excel)

When you press and hold Ctrl, you can select multiple individual worksheets and group them together. If you have a much larger workbook, though, this is impractical.

按住Ctrl時,可以選擇多個單獨的工作表並將它們分組在一起。 但是,如果您有更大的工作簿,這是不切實際的。

If you want to group all the worksheets in an Excel workbook, you can save time by right-clicking one of the worksheets listed at the bottom of the Excel window.

如果要對Excel工作簿中的所有工作表進行分組,可以通過右鍵單擊Excel視窗底部列出的工作表之一來節省時間。

From here, click “Select All Sheets” to group all your worksheets together.

在這裡,單擊“選擇所有工作表”將所有工作表分組在一起。

Click "Select All Sheets."

在Microsoft Excel中取消工作表分組 (Ungrouping Worksheets in Microsoft Excel)

After you’ve finished making changes to multiple worksheets, you can ungroup them in two ways.

完成對多個工作表的更改後,可以用兩種方式取消對它們的分組。

The quickest method is to right-click a selected worksheet at the bottom of the Excel window, and then click “Ungroup Sheets.”

最快的方法是右鍵單擊Excel視窗底部的選定工作表,然後單擊“取消工作表分組”。

Click "Ungroup Sheets."

You can also ungroup individual sheets one at a time. Just press and hold Ctrl, and then select the sheets you want to remove from the group.Worksheet tabs you ungroup will return to a gray background.

您也可以一次取消單個工作表的分組。 只需按住Ctrl,然後選擇要從組中刪除的工作表即可。 您取消分組的工作表選項卡將返回灰色背景。

翻譯自: https://www.howtogeek.com/557433/how-to-group-worksheets-in-excel/