Results 1 to 7 of 7

How to share header code w/ office

Threaded View

  1. #1
    Registered User
    Join Date
    04-06-2011
    Location
    Chapel Hill, nc
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to share header code w/ office

    I have been using a BeforePrint command to put a header/footer on all my workbooks. I would like everyone in the office to use this and would like to make it as user friendly as possible. I currently a+F11 and paste it into new docs. I'd like to be able to assign a shortcut to it, but I am not sure how to alter it so that
    a) it will work with a shortcut and
    b) so that it can be easily shared with other users.

    The code i pieced together:
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
        Dim wkSht As Worksheet
        For Each wkSht In ThisWorkbook.Worksheets
            With wkSht.PageSetup
                .RightHeader = "&B&""Calibri""&9&A" & vbLf & "&9Page &P of &N"
                .LeftFooter = "&B&""Calibri""&9&Z&F"
                .RightFooter = "&B&""Calibri""&9Printed " & _
                    Format(Now, "mm/dd/yyyy hh:mm AM/PM") & vbLf & "&9Last saved " & _
                    Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time"), _
                    "mm/dd/yyyy hh:mm AM/PM") & vbLf & "&9 Saved by " & _
                    Format(ThisWorkbook.BuiltinDocumentProperties("Last Author"))
            End With
            Next wkSht
    End Sub
    Thanks in advance.
    Last edited by romperstomper; 04-06-2011 at 10:29 AM. Reason: add tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1