Microsoft KB Archive/322761

= Indents may not print if Fit to Page is combined with Print Row and Column Headings =

Article ID: 322761

Article Last Modified on 6/4/2007

-

APPLIES TO


 * Microsoft Office Excel 2007
 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition

-



This article was previously published under Q322761



SYMPTOMS
When you print or preview a worksheet that contains indented cells in Microsoft Excel, the indents may not be printed or displayed. This problem occurs if you try to set both of the following Print Setup options, and if you are printing to a PCL driver:
 * Print Row and Column Headings
 * Fit to  pages wide by   tall



WORKAROUND
To work around this problem, use one of the following methods.

Method 1
You can use the following macro code to replace each indent with spaces that simulate indents, and then print the worksheet. Sub RemoveIndents 'Each indent places approximately 3 character widths ' of space at the beginning of the cell ' Macro tests for the indent level and ' replaces each indent with 3 spaces For Each c In ActiveSheet.UsedRange.Cells If c.IndentLevel > 0 Then padstring = String(c.IndentLevel * 3, &quot; &quot;) c.Value = padstring & c.Text c.IndentLevel = 0 End If   Next End Sub To remove the spaces and replace the indents, run this code. Sub ReplaceIndents 'Macro tests for spaces at the beginning of the cells 'and replaces each indent with 3 spaces Dim OldLevel As Byte 'used to hold the indentlevel you need For Each c In ActiveSheet.UsedRange If InStrRev(c.Text, &quot; &quot;) > 0 Then OldLevel = (InStrRev(c.Text, &quot; &quot;) + 2) / 3 of the cell, divides by 3 to give indentlevel c.Value = Right(c.Text, Len(c.Text) - _                InStrRev(c.Text, &quot; &quot;) - 2) c.IndentLevel = OldLevel End If    Next c End Sub

Method 2
Use a PostScript printer driver to print your worksheet.



STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the &quot;Applies to&quot; section.

Microsoft is researching this problem and will post more information in this article when the information becomes available.

Additional query words: fit to page row columns headings XL2002 XL2003 XL2007

Keywords: kbfix kbprb KB322761

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.