Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
CLDelafield
 
Posts: n/a
Default How do I print a footer on the last page only of an excel doc?

How do I print a footer on the last page only of an excel doc? Is this
possible?
  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi

Only with code

Sub test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"CLDelafield" wrote in message ...
How do I print a footer on the last page only of an excel doc? Is this
possible?



  #3   Report Post  
Jim Cone
 
Posts: n/a
Default

CLD,

Print all pages except the last page.
Add the footer information.
Print the last page.
Close the workbook without saving.

Jim Cone
San Francisco, USA


"CLDelafield" wrote in message
...
How do I print a footer on the last page only of an excel doc?
Is this possible?
  #4   Report Post  
DNA
 
Posts: n/a
Default

If, when you say pages, you're referring to sheets or worksheets, then the
answer is simple.

If you place a header or a footer on Sheet1, it does not automatically go
to the other sheets; therefore, put your footer on the last worksheet and
print all pages.

HTH and I'm not missing something.

  #5   Report Post  
Jim May
 
Posts: n/a
Default

Even at xl2003 version, are we still bound to "Excel4Macro" code to acheive
TotPages? hummm..
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
TIA,


"Ron de Bruin" wrote in message
...
Hi

Only with code

Sub test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"CLDelafield" wrote in message
...
How do I print a footer on the last page only of an excel doc? Is this
possible?







  #6   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi Jim

As far as I know Yes

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Jim May" wrote in message news:nh8Ee.81579$Fv.72754@lakeread01...
Even at xl2003 version, are we still bound to "Excel4Macro" code to acheive TotPages? hummm..
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
TIA,


"Ron de Bruin" wrote in message ...
Hi

Only with code

Sub test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl


"CLDelafield" wrote in message ...
How do I print a footer on the last page only of an excel doc? Is this
possible?







  #7   Report Post  
Posted to microsoft.public.excel.misc
TC TC is offline
external usenet poster
 
Posts: 32
Default How do I print a footer on the last page only of an excel doc?

I have some experience with VB code but not much. Could someone please
explain what parts of this code I have to edit and enter specific information
for my worksheet to get this code to run.
Thanks
Tim
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How do I print a footer on the last page only of an excel doc?

Hi Tc

I not see code but I have this on my site
http://www.rondebruin.nl/print.htm#Header

You can do this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"TC" wrote in message ...
I have some experience with VB code but not much. Could someone please
explain what parts of this code I have to edit and enter specific information
for my worksheet to get this code to run.
Thanks
Tim



  #9   Report Post  
Posted to microsoft.public.excel.misc
TC TC is offline
external usenet poster
 
Posts: 32
Default How do I print a footer on the last page only of an excel doc?

Ron,
I was using your code from below.
Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub

Is there any way for the code to recognize the footer information that I
have typed in for the worksheet. Instead of having to type it in the line
..rightfooter = "Your Header info"
Also how do you change the code so that it prints on the first page and not
on any of the remaining pages?

Thanks
Tim

"Ron de Bruin" wrote:

Hi Tc

I not see code but I have this on my site
http://www.rondebruin.nl/print.htm#Header

You can do this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"TC" wrote in message ...
I have some experience with VB code but not much. Could someone please
explain what parts of this code I have to edit and enter specific information
for my worksheet to get this code to run.
Thanks
Tim




  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How do I print a footer on the last page only of an excel doc?

I was using your code from below.

The code I posted is not the site code but only print the footer on the last page

Is there any way for the code to recognize the footer information that I
have typed in for the worksheet. Instead of having to type it in the line
.rightfooter = "Your Header info"


Add your header info in a cell outside you print area
You can use this value in the macro then.

Also how do you change the code so that it prints on the first page and not
on any of the remaining pages?


Sub Test2()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = Range("Z1").Value
ActiveSheet.PrintOut From:=1, To:=TotPages - 1, preview:=True
.RightFooter = ""
ActiveSheet.PrintOut From:=2, To:=TotPages, preview:=True
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"TC" wrote in message ...
Ron,
I was using your code from below.
Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub

Is there any way for the code to recognize the footer information that I
have typed in for the worksheet. Instead of having to type it in the line
.rightfooter = "Your Header info"
Also how do you change the code so that it prints on the first page and not
on any of the remaining pages?

Thanks
Tim

"Ron de Bruin" wrote:

Hi Tc

I not see code but I have this on my site
http://www.rondebruin.nl/print.htm#Header

You can do this

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With ActiveSheet.PageSetup
.RightFooter = ""
ActiveSheet.PrintOut From:=1, To:=TotPages - 1
.RightFooter = "Your Header info"
ActiveSheet.PrintOut From:=TotPages, To:=TotPages
End With
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"TC" wrote in message ...
I have some experience with VB code but not much. Could someone please
explain what parts of this code I have to edit and enter specific information
for my worksheet to get this code to run.
Thanks
Tim








  #11   Report Post  
Posted to microsoft.public.excel.misc
TC TC is offline
external usenet poster
 
Posts: 32
Default How do I print a footer on the last page only of an excel doc?

Ron,
Thank you very much for all of your help. I think I have envery thing
working the way I want.
Thanks
Tim
  #12   Report Post  
Posted to microsoft.public.excel.misc
TC TC is offline
external usenet poster
 
Posts: 32
Default How do I print a footer on the last page only of an excel doc?

Ron,
When I run the code in the VB editor it does everything that I want it to.
However when I go to print preview in Excel the footer information doesn't
appear. Or when I go to view header/ footer it is not thier either. In my
earlier attempts to get everything working it did appear in the view header/
footer but I have not been able to repete this. I know there is an auto open
feature for macros in Excel but I have not been able to figure it out.

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With Worksheets("Sheet1").PageSetup
..CenterFooter = Worksheets("Sheet2").Range("A1:A2").Value
ActiveSheet.PrintOut From:=1, To:=TotPages - 1, preview:=True
..CenterFooter = ""
ActiveSheet.PrintOut From:=2, To:=TotPages, preview:=True
End With
End Sub

Thank you for all of your help.
Tim
  #13   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How do I print a footer on the last page only of an excel doc?

It Clear the footer for the last pages so that's why you not see it

.CenterFooter = ""




--
Regards Ron de Bruin
http://www.rondebruin.nl



"TC" wrote in message ...
Ron,
When I run the code in the VB editor it does everything that I want it to.
However when I go to print preview in Excel the footer information doesn't
appear. Or when I go to view header/ footer it is not thier either. In my
earlier attempts to get everything working it did appear in the view header/
footer but I have not been able to repete this. I know there is an auto open
feature for macros in Excel but I have not been able to figure it out.

Sub Test()
Dim TotPages As Long
TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)")
With Worksheets("Sheet1").PageSetup
.CenterFooter = Worksheets("Sheet2").Range("A1:A2").Value
ActiveSheet.PrintOut From:=1, To:=TotPages - 1, preview:=True
.CenterFooter = ""
ActiveSheet.PrintOut From:=2, To:=TotPages, preview:=True
End With
End Sub

Thank you for all of your help.
Tim



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
tOTALS WON'T PRINT ON SAME PAGE annes519 New Users to Excel 2 June 3rd 05 11:12 PM
My scaling is set to print 1x1 pages. But it prints 1000's of page Graeme Excel Worksheet Functions 0 March 23rd 05 01:15 AM
print selected sections on the same page ripley Excel Discussion (Misc queries) 1 February 22nd 05 04:04 PM
Getting rid of 2nd Page on Print. Shadyhosta New Users to Excel 3 December 30th 04 12:36 PM
print header or footer on first page only nadinep Excel Discussion (Misc queries) 2 December 11th 04 05:25 PM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"