Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Look here
http://www.j-walk.com/ss/excel/tips/tip22.htm You can run this macro to change all files in the folder C:\Data Sub test() Dim mybook As Workbook Dim FNames As String Dim MyPath As String Dim SaveDriveDir As String SaveDriveDir = CurDir MyPath = "C:\Data" ChDrive MyPath ChDir MyPath FNames = Dir("*.xls") If Len(FNames) = 0 Then MsgBox "No files in the Directory" ChDrive SaveDriveDir ChDir SaveDriveDir Exit Sub End If Application.ScreenUpdating = False Set basebook = ThisWorkbook Do While FNames < "" Set mybook = Workbooks.Open(FNames) For Each sht In mybook.Sheets sht.PageSetup.LeftFooter = mybook.FullName Next sht mybook.Close True FNames = Dir() Loop ChDrive SaveDriveDir ChDir SaveDriveDir Application.ScreenUpdating = True End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Muxer" wrote in message news:Wkodc.225070$Cb.2000687@attbi_s51... Hello, Can anyone show me some examples of how to add the file name and path of workbook to the footer. I would like to do this to all *.xls files in a folder. Since at times there is going to be hundreds of files, is it fastest and/or easier to do this via an add-in, macro or from VB6? Regards, LRR |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to extract only file name from folder path string in Excel? | Excel Worksheet Functions | |||
How to print file path in footer as default option for all files? | Excel Worksheet Functions | |||
Launching an XL file gives errors for each folder in path, then opens | Excel Discussion (Misc queries) | |||
Path and File Name to Footer | Excel Discussion (Misc queries) | |||
print file path and location in a footer | New Users to Excel |