Results 1 to 7 of 7
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Last edited by (2002)

    I'm not often in Excel, but today....

    I need to display the user who lasted edited a worksheet:

    Last edited by: John Q. Private

    How can I do this?

    Many thanks all ye Excellers. (ex-cellars??)
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Last edited by (2002)

    In VB something like:
    MsgBox( "The last Author of this document was:" & vbcrlf & ActiveWorkbook.builtindocumentproperties("last Author"))

    or in the immediate window:
    ?ActiveWorkbook.builtindocumentproperties("last Author")

    Steve

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Last edited by (2002)

    Kevin,

    I'm not sure where I found this code but it will produce a printout of the file attributes.

    Option Explicit

    Sub PrintDocProperties()
    Dim p As DocumentProperty
    Dim i As Integer
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    On Error Resume Next
    ActiveWorkbook.Worksheets.Add
    i = 1
    For Each p In ActiveWorkbook.BuiltinDocumentProperties
    Cells(i, 1) = p.Name
    Cells(i, 2) = p.Value
    i = i + 1
    Next p
    For Each p In ActiveWorkbook.CustomDocumentProperties
    Cells(i, 1) = p.Name
    Cells(i, 2) = p.Value
    i = i + 1
    Next p
    Columns("A:B").Select
    Selection.Columns.AutoFit
    With ActiveSheet
    .PageSetup.CenterHeader = "Properties for " & ActiveWorkbook.FullName
    .PageSetup.PrintGridlines = True
    .PrintOut
    .Delete
    End With
    Application.ScreenUpdating = True
    Application.DisplayAlerts = True
    End Sub


    John

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Last edited by (2002)

    Thanks, Steve. Do you know if there's a worksheet function that'll do it?
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  5. #5
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Last edited by (2002)

    John,
    Excellent. That's very nice. Thanks.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Last edited by (2002)

    No builit-in functionOnly a UserDefinedFunction:
    <pre>Option Explicit
    Function LastEditedBy()
    LastEditedBy = ActiveWorkbook.BuiltinDocumentProperties("last Author")
    End Function
    </pre>


    Once added to module, put into a cell:
    <pre>=lasteditedby()</pre>

    and you will get an answer based on the option entered "userName" in tools-options-general tab.

    If you add it to personal.xls it will always be available, but you will have to call it via:
    <pre>=personal.xls!lasteditedby()</pre>


    Steve

  7. #7
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Last edited by (2002)

    Thanks, Steve. I'll go with this except I think I'll put
    the function in the workbook and call it in Workbook_Open.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

Posting Permissions

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