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.
Bookmarks