Put file date is a cell

J

Jay

I want to put the date the file was saved into the footer
of my spreadsheet. I wrote a small user defined function
that incorporates FileDateTime(). I can get the date to
appear in a msgbox, but when I try to use the same
function to write to a cell, I get an error. It
says "That name is not valid". What am I doing wrong and
how do I fix it?

Here is my code:

Public Function MyDate() As Variant

' Get the file date and export it to a cell.
MyDate = FileDateTime("thisfile.xls")
MsgBox MyDate, vbOKOnly, "Current"

End Function

Thanks,

Jay
 
P

Paul B

Jay, this will put the date in A1 and also in the footer when you save the
workbook, will this do what you want?
--
Paul B
Always backup your data before trying something new
Using Excel 97 & 2000
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
Top