Subscribe to this feed

Navigation

Recent Posts

Archive

Macro to insert footer

Tuesday 03 Nov, 2009 - 23:46pm | 0 comments |

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

Posted in: Business
Tags: Excel | Macro | VBA

Comment
 | Link | back to top | del.icio.us digg it furl reddit

© Eriginal Ltd 2011, all rights reserved