Can I display the file properties of a workbook in a custom headi.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am sharing a workbook with another user where I work and we both make
changes to it on a regular basis. I am wondering if there is a function that
can display the name of the last person who saved it and the last date it was
saved so that we don't have to go into the header and manually update this
information each time we change something in the workbook.

Thanks!
 
Sings

User Defined Function, not built-in.

Function DocProps(prop As String)
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

In A1 enter =DOCPROPS("author")
In B1 enter =DOCPROPS("last save time")

Then run this macro

Sub CellInFooter()
With ActiveSheet
.PageSetup.RightFooter = .Range("A1").Text & _
" " & .Range("B1").Text
End With
End Sub


Gord Dibben Excel MVP
 
A much shortened version without the cells being populated.

Mis-read original question. So what else is new?<g>

Sub footer()
ActiveSheet.PageSetup.RightFooter = _
ActiveWorkbook.BuiltinDocumentProperties("last author") _
& " " & ActiveWorkbook.BuiltinDocumentProperties("last save time")
End Sub


Gord
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top