DATES IN EXCELL

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

Guest

IS THERE ANY WAY TO MAKE AN EXCELL WORKSHEET SHOW THE DATE IT WAS ORIGIONALLY
CREATED AT THE TOP OF THE PAGE ? I KNOW HOW TO USE =TODAY AND =NOW FUNCTIONS
BUT THESE RESET THE DATE AND TIME EACH TIME THE SHEET IS SAVED OR MODIFIED. I
NEED TO SHOW THE DATE OF CREATION AS WELL AS THE LAST DATE OF MODIFICATION ON
MY WORKSHEET. I USE EXCEL TO PREPARE MATERIAL LISTS IN CONSTRUCTION
ESTIMATION. ANY HELP WILL BE GREAT. THANKS
 
'-----------------------------------------------------------------
Function DocProps(prop As String)
'-----------------------------------------------------------------
Application.Volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocument­Properties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function


and enter in a cell such as

=DocProps ("creation date")



--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks Bob , i am an Excel rookie. I tried the =docprops() function and got a
#name error response, does this mean its not installed in my version?
 
What Bob sent is a FUNCTION written in VBA. To use it you must copy/paste to
a regular module and then SAVE your workbook. Then use it as you would an
excel formula as Bob showed you.
 
Dennis

Bob's docprops function is a user defined function(UDF), not a native Excel
function.

Must be copied into a general module in your workbook.

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and Insert>Module. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Enter the formula in a cell as =docprops("creation date")


Gord Dibben Excel MVP
 
Thanks bob and Gord I will try that vba out and let you know if it works.
Thanks again for everyones help!
 

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