Automatically embedded date of creation in file


Posted by Stephen Allenberg on January 13, 2002 5:29 PM

This should be an easy one for you - if it is possible

I work on spreadsheets daily and then save them to
refer to them later or update them. What I would
like to achieve is :

When I actually work on a spreadsheet (not just
open it)- the date that I creted the worksheet will
automatically be embedded in the worksheet and only
changed should should I rename the sheet.

What I am trying to achieve is the the creation dates
of each file - not the details date that are shown in
the folder section - tthat is too easily changed.

Is there perhaps a Macro could use (I am well versed
at programming in Qbasic if this can be used)or is
there some simpler way as I don't intend getting
involved in Visual bacic and Excel programming.

I thank anyone for any assistance that they are
able to offer


Regards
Stephen Allenberg

Posted by Jacob on January 13, 2002 6:55 PM

Hi

You want to save a date for each sheet when it was made and only change that date if the sheet is renamed right?

Then
Lets keep the info in cell Y1 & Z1 Modify as needed

Private Sub Workbook_SheetActivate(ByVal Sh As Object)

if activesheet.name = range("Y1").value then
exit sub
else
range("Y1") = activesheet.name
range("Z1") = date
end if
End Sub

HTH

Jacob

Posted by Stephen Allenberg on January 14, 2002 6:19 AM

Jacob

Thank you for the help you are correct in you analysis of what I am trying to do - please would you explain how I go about entering the details you have given.

: This should be an easy one for you - if it is possible : refer to them later or update them. What I would : like to achieve is : : open it)- the date that I creted the worksheet will : automatically be embedded in the worksheet and only : changed should should I rename the sheet. : : What I am trying to achieve is the the creation dates : of each file - not the details date that are shown in : the folder section - tthat is too easily changed. : at programming in Qbasic if this can be used)or is : there some simpler way as I don't intend getting : involved in Visual bacic and Excel programming. : able to offer : Regards : Stephen Allenberg



Posted by Jacob on January 14, 2002 7:31 PM

Hi

Copy the code to the workbook section of VBA (Alt+F11)

: Hi : You want to save a date for each sheet when it was made and only change that date if the sheet is renamed right? : Then : Lets keep the info in cell Y1 & Z1 Modify as needed : Private Sub Workbook_SheetActivate(ByVal Sh As Object) : if activesheet.name = range("Y1").value then : exit sub : else : range("Y1") = activesheet.name : range("Z1") = date : end if : End Sub : HTH : Jacob :