+ Reply to Thread
Results 1 to 6 of 6

"Last modified by" in Excel Footer

  1. #1
    Registered User
    Join Date
    10-02-2006
    Posts
    2

    "Last modified by" in Excel Footer

    I have a footer that I place in all my Word documents it goes a little something like this:

    Created by (insert name) on (insert dated) - Last modified by (insert name) on (insert date)

    I would really like to design an excel footer that does the same thing but I can't work out how.

    Any suggestions?

  2. #2
    Forum Contributor kraljb's Avatar
    Join Date
    05-26-2004
    Location
    Illinois
    MS-Off Ver
    2007 (recent change)
    Posts
    256
    If you add this macro on the workbook it will add the last modified everytime the workbook is saved...

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
    Dim i As Integer

    For i = 1 To Worksheets.Count
    With Worksheets(1)
    .PageSetup.RightFooter = "Last Modified By: " & Application.UserName & " On: " & Format(Now, "m/d/yy")
    End With
    Next i



    End Sub

    Hope that helps...

  3. #3
    Registered User
    Join Date
    10-02-2006
    Posts
    2
    I'm having trouble with this macro. How exactly do I create it? When I go Alt-F8 I get the macro window but "create" is greyed out. I tried recording a new macro and then editing it and copy/paste in the marco from your above post but it wouldn't let me do this.

    Thanks for your help.

  4. #4
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,196
    Quote Originally Posted by Muz
    I'm having trouble with this macro. How exactly do I create it? When I go Alt-F8 I get the macro window but "create" is greyed out. I tried recording a new macro and then editing it and copy/paste in the marco from your above post but it wouldn't let me do this.

    Thanks for your help.
    Press Alt/F11 (or rightmouse the sheet tab and select 'View Code', then select ThisWorkbook

    Copy the code and Paste it into the code area (of ThisWorkbook)
    Please Login or Register  to view this content.

  5. #5
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    11,901
    1. Right click any sheet tab
    2. Select "show code"
    3. When the Visual Basic editor opens, in the VB Project pane,
    double-click ThisWorkBook
    4. Paste the given code
    5. Close the VB editor and save the workbook
    6. Select "Print Preview" from the "File" menu, you should see
    the desired footer...
    Ben Van Johnson

  6. #6
    Registered User
    Join Date
    05-31-2007
    Posts
    1

    many thanks

    I have been looking for something like this for a 'template' so that many users of a sdocument will know who 'last saved' the excel 2007 document
    I saved this as a macro enabled template and it works a treat.....
    Except that if you have more than one 'sheet' it falls back to nothing in the footer
    So can anyone help with this coding to make it happen for all sheets
    It would be great if it could also have the origional creator of the document as well as the 'last saved by'

+ Reply to Thread

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