Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

If you use the SUBTOTAL function to calculate the subtotal of a list in a worksheet that contains a user-defined function, the user-defined function may be calculated more times than expected in Excel


View products that this article applies to.

Symptoms

You are using a worksheet that contains a user-defined function in Microsoft Office Excel 2003 or in Microsoft Office Excel 2007. If you use the SUBTOTAL function to calculate the subtotal of a list of data in the worksheet, the user-defined function may be calculated more times than expected.

↑ Back to the top


Cause

This issue may occur if the user-defined function is called more than one time. The user-defined function is called more than one time when the following conditions are true:
  • You used the following procedure to remove the subtotals from the worksheet:
    1. You selected the list that contains the subtotals.
    2. In Excel 2003, you clicked Subtotals on the Data menu, and then you clicked Remove all.

      In Excel 2007, you clickedSubtotal in the Outline group on the Data, and then you clickedRemove all.
  • The list of data contains the user-defined function.

↑ Back to the top


Workaround

To work around this issue in Excel 2003, follow these steps:
  1. Select the list that contains the user-defined function.
  2. On the Edit menu, click Copy.
  3. On the Insert menu, click Worksheet.
  4. On the Edit menu, click Paste Special.
  5. In the Paste Special dialog box, click Paste Link.
To work around this issue in Excel 2007, follow these steps:
  1. Select the list that contains the user-defined function.
  2. Click Copy in the Clipboard group on the Home tab.
  3. Click the Insert Worksheet tab.
  4. Click the arrow on Paste, and then click Paste Special.
  5. In the Paste Special dialog box, click Paste Link.

↑ Back to the top


Keywords: KB898920, kbprb, kbtshoot, kbfunctions, kbexpertisebeginner

↑ Back to the top

Article Info
Article ID : 898920
Revision : 4
Created on : 2/6/2007
Published on : 2/6/2007
Exists online : False
Views : 306