MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Creatin a Macro to Insert the File name into a spreadsheet

Posted by Karin on January 13, 2001 11:46 AM

I keep getting a Syntax error when tryin to Add the File Path Name to Excel


Type: sub UpdateFooter()
Activesheet.PageSetup.LeftFooter =
End Sub
I recieve a syntax error when typing this in the Module. And then can not run the macro.
What is is the easiest way to insert the file name and location in an excel spreadhseet?
Your help would be appreciated
Thank you

Posted by Robert Faass on January 13, 2001 12:14 PM

Paste this code, it works:

Sub UpdateFooter()
ActiveSheet.PageSetup.LeftFooter = ActiveWorkbook.FullName
End Sub

between sub and end sub should be one line, OK?