Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print footer on last printed page only - vba ?

Status
Not open for further replies.

AndreasG

IS-IT--Management
Jun 28, 2002
15
GR
Hello

I work with excel 2000 and i want to print a specific line of text ( footer) automatically only on the last printed page.
for example i have an excel sheet which is 3 pages printed
i want the text " bla bla bla bla " to be printed only on the footer of the 3rd page

Is there anything you can do to help ?

thanks in advance

Andreas

Best Regards
Andreas
using xl2000 on win2k
 
I just answered a similar question last week. I don't know if it helped the person or not, but maybe it will help you. Not necessarily the method you are looking for, but it works in word. It probably will work in Excel as well. See

thread68-588739
 
hello there friends
fyi
this is the solution , thanks to Tim Urtis for his Help
-------------------------------------------------------

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
Application.EnableEvents = False
Dim LastPage As Long, PageNumber As Long

LastPage = ExecuteExcel4Macro("Get.Document(50)")
ActiveSheet.PageSetup.LeftFooter = ""
If LastPage > 1 Then
ActiveSheet.PrintOut From:=1, To:=LastPage - 1
End If
ActiveSheet.PageSetup.LeftFooter = Worksheets("Sheet2").Range("A1").Value
ActiveSheet.PrintOut From:=LastPage, To:=LastPage
ActiveSheet.PageSetup.LeftFooter = ""
Application.EnableEvents = True
Application.ScreenUpdating = True
Cancel = True
End Sub


bye for now



Best Regards
Andreas
using xl2000 on win2k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top