![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Location: NY, NY
Posts: 31
|
I'd like to create some code that would, upon saving a file, automatically add a centered footer containing FILE, TAB.
Any ideas? Many thanks for this great service! |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Posts: 169
|
Try something like this in the before save sub of the workbook. I hope this helps.
The &F stands for filename. Private Sub Workbook_BeforeSave() With ActiveSheet.PageSetup .CenterHeader = "&F" End With End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 255
|
Enter the following macro (or a variation on it)in ThisWorkbook:
Private Sub Workbook_BeforeClose (Cancel as Boolean) For Each sht in AcitveWorkbook.Sheets sht.PageSetup.CenterFooter = ActiveWorkbook.FullName Next sht End Sub |
|
|
|
|
|
#4 |
|
New Member
Join Date: Apr 2002
Location: NY, NY
Posts: 31
|
Thanks for the help!
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|