Home |
Search |
Today's Posts |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
tOTALS WON'T PRINT ON SAME PAGE | New Users to Excel | |||
My scaling is set to print 1x1 pages. But it prints 1000's of page | Excel Worksheet Functions | |||
print selected sections on the same page | Excel Discussion (Misc queries) | |||
Getting rid of 2nd Page on Print. | New Users to Excel | |||
print header or footer on first page only | Excel Discussion (Misc queries) |