View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Macros and Printing Footers

Hi greengrass,

What you're looking for is found in .PageSetup for each sheet. To add footer
info for page numbers and date, you'll need something like the following in
your code before you open the next file:

With ActiveSheet.PageSetup
.RightFooter = "&7 Page &P of &N" & Chr(10) & "&D"
End With

The result of the above code will be located right-aligned and will look
like this:

Page 1 of n
3/7/2006
where pages(n) is the number of pages of print for that sheet.

If you mean you want to number the sheets as in their indexes, you can use
the ActiveSheet.Index appended to a string value like "Sheet ", for example:

.LeftFooter = "Sheet " & ActiveSheet.Index &" of " & basebook.Sheets.Count

The index will increment for each sheet you copy into basebook.
Other choice: .CenterFooter = "something else"

As a reference, you can use the macro recorder to get a list of all the
properties used in PageSetup.
I hope this is helpful!
Regards,
GS