Adding "Last edited by" to header in excel

Occasional Visitor

How can I indicate who last edited a worksheet that will be printed?  Ultimately I'd like my header to read: Last edited on [date] [time] by [name of person who made most recent edit].

1 Reply

You could use the following VBA code to add the Last Author to every worksheet header


Let me know if you need assistance in pasting this into a module (via Alt+F11) and then right clicking on the file name and Inserting a module 



Option Explicit

Sub LastEdit()

Dim wks As Worksheet
Dim CustomHeader As String
Dim LastAuthor As String
Dim ActiveUser As String

LastAuthor = ActiveWorkbook.BuiltinDocumentProperties("Last Author")
' ActiveUser = Application.UserName   'could use ActiveUser instead of Last Author

CustomHeader = "Last Edited on " & Now() & " by " & LastAuthor

For Each wks In Worksheets

    wks.PageSetup.RightHeader = CustomHeader

Next wks

End Sub

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
23 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
cntvertex in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
28 Replies