Printing without Headers or Footers Using PAGE.SETUP in Excel (25764)



The information in this article applies to:

  • Microsoft Excel for Windows 95
  • Microsoft Excel for Windows 5.0c
  • Microsoft Excel for Windows 4.0c
  • Microsoft Excel for Windows 3.0a
  • Microsoft Excel for Windows 2.10d
  • Microsoft Excel for Windows 2.1
  • Microsoft Excel for Windows 2.01
  • Microsoft Excel for Windows 2.0
  • Microsoft Excel for Windows NT 5.0

This article was previously published under Q25764
In Microsoft Excel, use the following macro command to remove the header and footer from the active sheet:

   =PAGE.SETUP("","",0.75,0.75,1,1,TRUE,TRUE)
		
The double quotation marks for the header and footer indicate that an empty string is to be used for the header and footer.

In Microsoft Excel versions 5.0 and later, you can use the following code in a Visual Basic module to remove the header and footer from the active sheet:

   With ActiveSheet.PageSetup

      ' Set the value of each header and footer to empty
      .LeftHeader = ""
      .CenterHeader = ""
      .RightHeader = ""
      .LeftFooter = ""
      .CenterFooter = ""
      .RightFooter = ""

   End With
		

Modification Type:MinorLast Reviewed:8/15/2005
Keywords:KB25764