Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
And to remove the last 4 characters of the .name:
Private Sub Workbook_BeforePrint(Cancel As Boolean) dim myName as string myName = me.name worksheets("Somesheetnamehere").PageSetup.CenterHe ader _ = right(myname,len(myname)-4) End Sub I used the Me keyword--it refers to the object that owns the code. In this case, it's the workbook that's being printed. And I only changed a specific worksheet--not the activesheet. Gary''s Student wrote: Put the following in the Workbook event mcro area: Private Sub Workbook_BeforePrint(Cancel As Boolean) ActiveSheet.PageSetup.CenterHeader = ActiveWorkbook.Name End Sub -- Gary''s Student - gsnu2007b "Basharat A. Javaid" wrote: Is there a way to insert the file name in a footer/header without the ".xls" in the name? Basharat. -- Dave Peterson |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Header/Footer | Excel Discussion (Misc queries) | |||
How to insert page numbers in a file, not the header or footer | Excel Discussion (Misc queries) | |||
Header and Footer | Excel Worksheet Functions | |||
How do i import header and footer from diferent XLS file? | New Users to Excel | |||
Header & Footer | Excel Worksheet Functions |