Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2007

Tip: Looking for answers? Try searching our database.

Create date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David - 14 Nov 2007 21:41 GMT
Hello

I have a excel template that the user opens fills out and saves it by
giving it a filename. The problem I'm having is there is a a date field
that they need to enter in the date for that days information but they
are not filling it in. Is there a function I can put in that cell that
will put a date in it when the file is created?

The file is saved first thing in the morning and is filled out and saved
 throughout the day until the next morning

TIA
David
JP - 14 Nov 2007 21:57 GMT
How about this?

Function CreationDate() as String
    CreationDate = ActiveWorkbook.BuiltinDocumentProperties("Creation
Date").Value
End Function

In A1 enter =CreationDate()

HTH,
JP

> Hello
>
[quoted text clipped - 9 lines]
> TIA
> David
David - 15 Nov 2007 00:53 GMT
> How about this?
>
[quoted text clipped - 21 lines]
>> TIA
>> David

Can't seem to get it to work. Any other ideas
JP - 15 Nov 2007 01:34 GMT
It worked on my machine.

1. Did you paste it into a standard module?
2. Did you fix the word wrapping? The Google text editor wraps the
function and might cause unintended errors.

You might have to "qualify" the reference, for example if I put the
function into my personal (hidden) workbook, I would call the function
by typing =PERSONAL.XLS!CreationDate()

HTH,
JP

> > How about this?
>
[quoted text clipped - 25 lines]
>
> - Show quoted text -
Gord Dibben - 15 Nov 2007 01:48 GMT
That Function stored in a module in the Template will give you the creation date
of the Template only, not the workbook you just opened from the Template.

The opened workbook has no created date until it is saved.

To get a date for workbook just created you could place code in the Template
Thisworkbook module.

Note:you will have to open the Template itself to add the code, not just a
workbook opened from the Template.

Private Sub Workbook_Open()
If ActiveWorkbook.ActiveSheet.Range("A1") = "" Then
ActiveWorkbook.ActiveSheet.Range("A1").Value = Format(Date, "mmmm dd yyyy")
End If
End Sub

Note.....when you save the workbook the code will be saved with it, creating the
macro warning when the saved workbook is opened again.

It might be easier to train your users to hit CTRL + ; on a cell when they first
open the workbook.

Gord Dibben  MS Excel MVP

>> How about this?
>>
[quoted text clipped - 23 lines]
>>
>Can't seem to get it to work. Any other ideas
David - 15 Nov 2007 23:08 GMT
> That Function stored in a module in the Template will give you the creation date
> of the Template only, not the workbook you just opened from the Template.
[quoted text clipped - 48 lines]
>>>
>> Can't seem to get it to work. Any other ideas

Works Great now Thank you Both for your help
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.