Can I add Created Date?

D

Diane

What is the function to insert file properties? I need
the Created Date to show on each sheet.

Thanks in advance for your help!
Diane
 
J

John Wilson

Diane,

Compliments of a previous post by Bill Manville......

Function CreateDate()
CreateDate = _
Application.Caller.Parent.Parent.BuiltinDocumentProperties("Creation
Date")
End Function

Put =CreateDate() in a cell and format it as date &/or time, as
required.

John
 
B

Bob Phillips

Diane,

You need code, such as

Range("A1").Value = ActiveWorkbook.BuiltinDocumentProperties("Creation
Date")

and formant the cell as date format.
 
D

Diane

Hi,
I'm not completely experienced with macros, but I think I
did it correctly. But, when I put =CreateDate() in a
cell, I get a "Compile Error: Sytax Error" message. And
then in the debugger, the first line is highlighted:
Function CreateDate().

Any ideas?

I REALLY appreciate your help--thanks,
Diane
 
J

John Wilson

Diane,

Take that code that I gave you and place it in a regular module
in the VBA EDitor.

Alt + F11
Right click on "ThisWorkbook"
Select "Insert/Module"
Paste the following into the panel on the right.

Function CreateDate()
CreateDate =
Application.Caller.Parent.Parent.BuiltinDocumentProperties("Creation
Date")
End Function

Be careful of wordwrap in the above. That CreateDate = should be all one
line.
"Creation Date" should have a space in it.

Then you should be able to use
=Createdate()
in any cell in the workbook.

I'll send you a small file directly with the above coding.

John
 
C

cobrum

I tried to also use the formula shown for inserting the date but it
opens back into VBE and says Invalid Outside Procedure and shows the
"Creation Date" highlited.

I am using Excel 2000 9.0.36926 SP-3, does it require another name or
something here?
 

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

Top