Navigation
Recent Posts
Archive
The following macro will insert a footer giving the page numbers, file loaction and name, and the date and time on the active sheet.
Sub myfoot()
'Dim fullpath As String
'Dim sLeft As String
'Dim sRight As String
fullpath = ActiveWorkbook.FullName
Const sPAGE As String = "&P"
Const sPAGES As String = "&N"
Const sDATE As String = "&D"
Const sTIME As String = "&T"
sLeft = "Page " & sPAGE & " of " & sPAGES
sRight = sDATE & " " & sTIME
ActiveSheet.PageSetup.CenterFooter = fullpath
ActiveSheet.PageSetup.LeftFooter = sLeft
ActiveSheet.PageSetup.RightFooter = sRight
End Sub
© Eriginal Ltd 2011, all rights reserved