Suppressing a Header?

D

Donna

We have a header set up for our document and we would like
to suppress the header on page one only. Is this
possible? If so, how do we do that?
 
R

Ron de Bruin

With a macro you can do this for example to suppress the header on page 1

Sub test()
Totpage = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightHeader = ""
ActiveWindow.SelectedSheets.PrintOut From:=1, To:=1
.RightHeader = "&8Hi there"
ActiveWindow.SelectedSheets.PrintOut From:=2, To:=Totpage
End With
End Sub
 
G

Guest

Thank you for the information.

How do I get the text centered and then NOT have it print?
 
D

Dave Peterson

If you look at Ron's code, you'll see that it actually sets the rightheader to
"", then prints page 1.

Then it put something in that rightheader and prints from page 2 on.

I think I'd record a macro while creating the header exactly the way you want
it.

Then plop that into Ron's code. You may need to add .leftheader and
..centerheader to both portions.

If you have trouble, post back with your header strings from your recorded
macros (not the workbook itself).
 
D

Dave Peterson

I'm not quite sure why you'd want to suppress the printing--since the header is
really only updated when you're printing...

But you can add a Preview:=true to each of the .printout lines

ActiveWindow.SelectedSheets.PrintOut preview:=True, from:=1, to:=1

for instance.
 
Top