We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!

Excel modified?

Options
Morning all,

I'm currently working on an excel sheet at work, I need to be able to display who the file was last svaed by in the sheet itself.

I know I can find the information through Windows Explorer but would ideally like to be able to see it on the sheet itself. Also is there anyway to keep a log of edits?

Thanks :p
I would have used my own initiative if someone would have told me to!

Comments

  • isofa
    isofa Posts: 6,091 Forumite
    Use can use the last saved date stamp and Windows username via VBA to add a log, but you'll need to know how to, or if you aren't into technical programming, just use the track changes system in the Tools menu, but it must have been on before it's passed to all contributors.
  • Came across the following instructions on t'internet -
    does it do the job?

    You need to create a User Defined Function in VBA.

    Press ALT F11 to open the VBA Editor
    (VBE). There, press CTRL R to display the Project Explorer window if
    it is not already visible (typically on the left side of the screen).
    Find your project workbook in the Project Explorer, select it, then go
    to the Insert menu and choose Module. This will create a code module
    named Module1 in your workbook's VBA Project. In that module, enter
    the following code:


    Function GetProp(PropName As String, _
    Optional Reference As Excel.Range) As Variant
    On Error GoTo ErrH:
    Dim DocProps As Office.DocumentProperties
    Dim WB As Excel.Workbook
    If Reference Is Nothing Then
    Set WB = ThisWorkbook
    Else
    Set WB = Reference.Parent.Parent
    End If
    Set DocProps = _
    WB.BuiltinDocumentProperties
    GetProp = CStr(DocProps(PropName).Value)
    Exit Function
    ErrH:
    GetProp = CVErr(xlErrValue)
    End Function


    Now, close the VBE.

    Back in Excel, you can call this function from a cell with a function
    like

    =GetProp("Author")
    Filiss
  • This is an old bit of code I used a few years ago to stamp the date/time a file was last updated and by whom. Only problem is that the who bit is useless if the users name isn't set up in options. You just need to change Sheet1 and A2 & C2 to the sheet and cells you want it them to appear in.

    'runs automatically when workbook opened if changed to 'Sub Auto_Open()'
    Sub last_updated()
    Worksheets("Sheet1").Activate
    filex = ActiveWorkbook.Name
    Range("A2").Value = "Last Updated" & " " & FileDateTime(filex)
    Range("C2").Value = "by" & " " & Application.UserName
    End Sub
  • Greensprout
    Greensprout Posts: 1,476 Forumite
    Thanks! managed to get it working.
    Used code from both and a bit of google help and it works a treat. thanks!
    I would have used my own initiative if someone would have told me to!
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 350.9K Banking & Borrowing
  • 253.1K Reduce Debt & Boost Income
  • 453.5K Spending & Discounts
  • 243.9K Work, Benefits & Business
  • 598.7K Mortgages, Homes & Bills
  • 176.9K Life & Family
  • 257.2K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16.1K Discuss & Feedback
  • 37.6K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.