Frequently, multiple worksheets are used to further separate data into categories such as date or product type. The ability to work with data in multiple worksheets is a necessary skill for Excel users. For example, you may wonder: Is it possible to enter the same data into several worksheets without retyping or copying and pasting the text into each one? Or, how can you easily sum the cell values across multiple worksheets? Or, how can you list the names of the worksheets in your workbook? These five tips for Excel power users will help answer those questions and more.
Another common Excel task is to sum the value of a cell in multiple worksheets and then display the result in another cell. For example, you may want to sum the number of a particular product that customers have ordered over a period of time, such as by quarterly periods. If worksheets are formatted in the same way for each period, the total sales for the product always appears in the same cell in each worksheet. Finding the sum in this situation is simple. You can use a formula: 1. Start Excel. A new, blank workbook appears. 2. In cell B3 in Sheet1, type 20. 3. In cell B3 in both Sheet2 and Sheet3, type 30. 4. In cell A1 in Sheet1, type the following formula:
=SUM(Sheet1:Sheet3!B3)
5. Press ENTER. Notice that cell A1 displays 80, which is the total sum of the cells in the three worksheets.
In some instances, it is useful to be able to determine and list the names of the worksheets in your Excel workbooks. For example, you might want to create an index to catalog the worksheets in your workbook. You could then store the results in a separate worksheet. That way, you can quickly find the location of a particular worksheet. Try it: 1. Start Excel. A new, blank workbook appears. 2. Add a command button to the worksheet:
Select Sheet1. On the View menu, point to Toolbars, and then click Control Toolbox. Click the Command Button button. Click somewhere on the worksheet to insert the command button, and then click and drag the borders of the command button to size it. 3. Now, add Visual Basic code to the command button: Right-click the command button, and then click View Code on the shortcut menu. In the Microsoft Visual Basic Editor, enter the following code between the Private Sub CommandButton1 statement and the End Sub statement:
A new worksheet is created, listing the names of all the worksheets in the workbook.
For Each Sht In ActiveWindow.SelectedSheets i = i + 1 ReDim Preserve arSheetNames(1 To i) arSheetNames(i) = Sht.Name Next Sht startSheet = arSheetNames(LBound(arSheetNames)) endSheet = arSheetNames(UBound(arSheetNames)) Worksheets("Sheet1").Range("A1").Formula = "=SUM(" & startSheet & ":" & endSheet & "!B3)"
8. On the File menu, click Close and Return to Microsoft Excel. 9. On the Control Toolbox, click Exit Design Mode to quit design mode and enable the command button. 10. In cell B3 of Sheet1, type the value 20. 11. In cell B3 of Sheet2, type 30, and then in cell B3 of Sheet3, type 40. Click Sheet1. 12. Hold down the SHIFT key, and then click Sheet1 and Sheet2 to select just those worksheets. 13. Click the command button on Sheet1 and notice that the value displayed in cell A1 is 50. This is the sum of cell B3 for Sheet1 and Sheet2. 14. Hold down the SHIFT key and click Sheet3 so that all three sheets are selected. Click the command button. Notice that the total in cell A1 is now 90, which is the sum of cell B3 for all three worksheets.