5 tips for working with multiple worksheets in Excel

Power User Corner

By Frank C. Rice

Many projects involving Excel require you to work with a number of worksheets in a workbook. And often, the changes you make in one worksheet affect the data in another. Check out these five tips for working with data in multiple worksheets.

Applies to
Microsoft Excel 2002

See all Power User columns
See all columns


Worksheets provide a logical and intuitive way to organize your data in Microsoft Excel. 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.

Enter data in multiple worksheets at the same time

As an example, let's say you want to put the same title text into different worksheets. One way to do this is to type the text in one worksheet, and then copy and paste the text into the other worksheets. If you have several worksheets, this can be very tedious.

An easier way to do this is to use the CTRL key:

  1. Start Excel. A new, blank workbook appears.
  2. Press and hold the CTRL key, and then click Sheet1, Sheet2, and Sheet3.
  3. Click in cell A1 in Sheet1, and then type:

    This data will appear in each sheet.
  4. Click Sheet2 and notice that the text you just typed in Sheet1 also appears in cell A1 of Sheet2. The text also appears in Sheet3.

Sum the value of a cell across multiple worksheets

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.

Run the spelling checker on multiple worksheets simultaneously

You can check your spelling in multiple worksheets simultaneously:

  1. Start Excel. A new, blank workbook appears.
  2. In cell A1 in Sheet1, type any text you want. Repeat this step for Sheet2 and for Sheet3.
  3. Press and hold the SHIFT key, and then click Sheet1, Sheet2, and Sheet3.
  4. On the Tools menu, click Spelling.

The spelling checker checks the spelling on each of the worksheets you selected.

List the names of 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:
Set NewSheet = Sheets.Add(Type:=xlWorksheet)
  For i = 1 To Sheets.Count
  NewSheet.Cells(i, 1).Value = Sheets(i).Name
  Next i
  1. On the File menu, click Close and Return to Microsoft Excel.
  2. On the Control Toolbox, click Exit Design Mode to quit design mode and enable the command button.
  3. Click the command button on Sheet1.

A new worksheet is created, listing the names of all the worksheets in the workbook.

Test to see which worksheets have been selected

You can select multiple worksheets by holding down the SHIFT key and then clicking each worksheet name. Sometimes, you may want to know which worksheets have been selected so you can use that information for other purposes. For example, you may want to make calculations for just those worksheets that the user has selected. The following steps expand on the example demonstrated when we summed the value of cells across multiple worksheets.

  1. Start Excel. A new, blank workbook appears.
  2. Select Sheet1.
  3. On the View menu, point to Toolbars, and then click Control Toolbox.
  4. Click the Command Button.
  5. Click somewhere on the worksheet to insert the command button, and then click and drag the borders of the command button to size it.
  6. Right-click the command button, and then click View Code on the shortcut menu.
  7. In the Visual Basic Editor, enter the following code between the Private Sub CommandButton1 statement and the End Sub statement:
Dim Sht As Object
Dim arSheetNames() As String
Dim i As Integer

i = 0
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)"

  1. On the File menu, click Close and Return to Microsoft Excel.
  2. On the Control Toolbox, click Exit Design Mode to quit design mode and enable the command button.
  3. In cell B3 of Sheet1, type the value 20.
  4. In cell B3 of Sheet2, type 30, and then in cell B3 of Sheet3, type 40. Click Sheet1.
  5. Hold down the SHIFT key, and then click Sheet1 and Sheet2 to select just those worksheets.
  6. 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.
  7. 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.

Keep sending that e-mail!

We look forward to receiving your e-mail messages at pwruser@microsoft.com. We really want this to be your column, so please send us your comments and favorite handcrafted Office solutions. Remember, we will not be able to feature every Office solution that we receive, we will not have the time to respond to all of your e-mail, and we are not technical support representatives. But we may feature your solution in an upcoming column.


About the author

Frank C. Rice works for the Office Developer Center team. In addition to contributing to the Office Power User Corner column, Frank writes developer articles for the Microsoft Developer Network (MSDN).

If you like this column and want to hear about more fun and useful Office offerings, sign up for our newsletter.

See all Power User columns
See all columns