XL2000: Print Area with Merged Cells May Be Set Incorrectly (211744)



The information in this article applies to:

  • Microsoft Excel 2000

This article was previously published under Q211744

SYMPTOMS

When you set a print area on a worksheet in Microsoft Excel 2000, the print area may not be set correctly if the worksheet contains any merged cells. Specifically, it may be the case that only part of a merged cell is included in the print area. As a result, when you print the worksheet, the output may not contain all of the expected information.

CAUSE

This behavior can occur if you use either of the following methods to set the print area:
  • While a range of cells is selected, you type print_area in the Name box and press ENTER.

    -or-
  • In a Microsoft Visual Basic for Applications macro, you set the print area by using a line of code similar to the following:
    ActiveSheet.PageSetup.PrintArea = Range("B2").Address
    						
    In this example, B2 is the address of a cell that is part of a merged cell.

WORKAROUND

To work around this issue, use any of the following methods to set a print area:
  • Instead of typing print_area in the Name box, point to Print Area on the File menu, and then click Set Print Area. -or-

  • If you are using a macro to set the print area, modify the code so that it uses the Selection property instead of the Range property.

    For example, if your code currently looks like this
    ActiveSheet.PageSetup.PrintArea = Range("B2").Address
    					
    change it to the following:
    Range("B2").Select
    ActiveSheet.PageSetup.PrintArea = Selection.Address
    					
    -or-

  • Make sure that the range referred to by the macro includes all of the cells that have been merged; for example:

    ActiveSheet.PageSetup.PrintArea = Range("B2:F20").Address

By using any of these methods, you ensure that the print area is set correctly.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

Modification Type:MinorLast Reviewed:10/11/2006
Keywords:kbbug kbpending kbprint KB211744