Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Hoff
 
Posts: n/a
Default insert the date the file was last modified

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im

Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?




  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im

Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?





  #3   Report Post  
Jim May
 
Posts: n/a
Default

This isn't working - in UDF should prop be in ( ) ?
Back in sheet1 cell b4 what exactly does one enter?
= DOCPROPS("last time saved") doesn't get it
is there a substitute for last time saved, here/,...*&^%*&
Daaa,

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?







  #4   Report Post  
Jim May
 
Posts: n/a
Default

Never mind
It's: last save time
not: last time saved
my dyslexia at work..
daaa


"Jim May" wrote in message
news:zd3Nd.54958$jn.35197@lakeread06...
This isn't working - in UDF should prop be in ( ) ?
Back in sheet1 cell b4 what exactly does one enter?
= DOCPROPS("last time saved") doesn't get it
is there a substitute for last time saved, here/,...*&^%*&
Daaa,

"Gord Dibben" <gorddibbATshawDOTca wrote in message
...
Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"


wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im

Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make

one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was

last
modified
into a cell in Excel?









  #5   Report Post  
Hoff
 
Posts: n/a
Default

Thanks! That did it. I thought I had entered the code into a module, but it
I had not actually inserted a new one.
Thanks!

"Gord Dibben" wrote:

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?








  #6   Report Post  
moreta
 
Posts: n/a
Default


This works beautifully. Is there a way to put the date in an Excel
header/footer? That would be... excellent!

"Gord Dibben" wrote:

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?






  #7   Report Post  
John_Ostar
 
Posts: n/a
Default

Hi Moreta,

Here is what I use. Feel free to use it. Hopefully the comments are self
explainatory.
Good luck,

JohnO

' Author: John Ostar
' Last Modified: 10/10/2005
'Description:
'This VBA code will put the Workbook's Last Modified Date and Time into the
' printed page footer of all sheets, including charts, of the open
workbook.
' It is needed because MS-Excel does not have a field similar to
MS-Word's
' LastSaveDate that can just be easily added to a custom footer.
' This code will run everytime the workbook is saved.
'Installation: Open the desired Workbook. Click Tools-Macro-Visual Basic
Editor.
' In Project Explorer, double click on ThisWorkbook and paste this code
into it.
' Close the Visual Basic Editor and Save the Workbook.
'Note: It will be necessary to set Tools-Macro-Security to Low or Medium

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Get the active workbook's last modified date property.
dtMyLastSaveDate = ActiveWorkbook.BuiltinDocumentProperties("Last Save
Time")

'Put value into center footer of every sheet in the workbook
For Each wsheet In Sheets
'the default date format is m/d/yy h:m:s AM/PM
'alternate format is m/d/yy h:mm am/pm
dtMyLastSaveDate = Format(dtMyLastSaveDate, "m/d/yy h:m am/pm")
wsheet.PageSetup.CenterFooter = "Last Modified: " & dtMyLastSaveDate
Next wsheet
End Sub

"moreta" wrote:


This works beautifully. Is there a way to put the date in an Excel
header/footer? That would be... excellent!

"Gord Dibben" wrote:

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?






  #8   Report Post  
John_Ostar
 
Posts: n/a
Default

Opps. One error in my comments left over from an earlier attempt.
'This code will run everytime the workbook is PRINTED (not saved).
Sorry.


"John_Ostar" wrote:

Hi Moreta,

Here is what I use. Feel free to use it. Hopefully the comments are self
explainatory.
Good luck,

JohnO

' Author: John Ostar
' Last Modified: 10/10/2005
'Description:
'This VBA code will put the Workbook's Last Modified Date and Time into the
' printed page footer of all sheets, including charts, of the open
workbook.
' It is needed because MS-Excel does not have a field similar to
MS-Word's
' LastSaveDate that can just be easily added to a custom footer.
' This code will run everytime the workbook is saved.
'Installation: Open the desired Workbook. Click Tools-Macro-Visual Basic
Editor.
' In Project Explorer, double click on ThisWorkbook and paste this code
into it.
' Close the Visual Basic Editor and Save the Workbook.
'Note: It will be necessary to set Tools-Macro-Security to Low or Medium

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Get the active workbook's last modified date property.
dtMyLastSaveDate = ActiveWorkbook.BuiltinDocumentProperties("Last Save
Time")

'Put value into center footer of every sheet in the workbook
For Each wsheet In Sheets
'the default date format is m/d/yy h:m:s AM/PM
'alternate format is m/d/yy h:mm am/pm
dtMyLastSaveDate = Format(dtMyLastSaveDate, "m/d/yy h:m am/pm")
wsheet.PageSetup.CenterFooter = "Last Modified: " & dtMyLastSaveDate
Next wsheet
End Sub

"moreta" wrote:


This works beautifully. Is there a way to put the date in an Excel
header/footer? That would be... excellent!

"Gord Dibben" wrote:

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?






  #9   Report Post  
Posted to microsoft.public.excel.misc
hjc
 
Posts: n/a
Default insert the date the file was last modified

Hi, John

I found your suggestion to be quite interesting because I am looking for a
way to define a 'default' header in Excel. When I print my spreadsheets, I
always like to include the workbook name (and folder), the worksheet name,
the date and time. Using your example, I was able to quickly define the
desired header for every sheet in my workbook. What I am wondering now is
whether there is a way to automatically include this code in any new workbook
I create, or whether I need to cut and paste it each time. That would be
almost as much of a pain as manually defining the header in each new workbook
is now.

I look forward to your reply. Thanks!
Hugh John Cook

"John_Ostar" wrote:

Hi Moreta,

Here is what I use. Feel free to use it. Hopefully the comments are self
explainatory.
Good luck,

JohnO

' Author: John Ostar
' Last Modified: 10/10/2005
'Description:
'This VBA code will put the Workbook's Last Modified Date and Time into the
' printed page footer of all sheets, including charts, of the open
workbook.
' It is needed because MS-Excel does not have a field similar to
MS-Word's
' LastSaveDate that can just be easily added to a custom footer.
' This code will run everytime the workbook is saved.
'Installation: Open the desired Workbook. Click Tools-Macro-Visual Basic
Editor.
' In Project Explorer, double click on ThisWorkbook and paste this code
into it.
' Close the Visual Basic Editor and Save the Workbook.
'Note: It will be necessary to set Tools-Macro-Security to Low or Medium

Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Get the active workbook's last modified date property.
dtMyLastSaveDate = ActiveWorkbook.BuiltinDocumentProperties("Last Save
Time")

'Put value into center footer of every sheet in the workbook
For Each wsheet In Sheets
'the default date format is m/d/yy h:m:s AM/PM
'alternate format is m/d/yy h:mm am/pm
dtMyLastSaveDate = Format(dtMyLastSaveDate, "m/d/yy h:m am/pm")
wsheet.PageSetup.CenterFooter = "Last Modified: " & dtMyLastSaveDate
Next wsheet
End Sub

"moreta" wrote:


This works beautifully. Is there a way to put the date in an Excel
header/footer? That would be... excellent!

"Gord Dibben" wrote:

Hoff

The UDF below goes into a General Module in the workbook.

With your workbook open hit ALT + F11 to get to the VBEditor.

CTRL + r to open the Project Explorer.

Find your workbook/project and right-click on it and InsertModule.

Copy and paste the DocProps UDF in there.

ALT + Q to go back to Excel.

In a cell enter =DocProps("last save time")

When happy with results, save the workbook.


Gord Dibben Excel MVP

On Fri, 4 Feb 2005 13:15:03 -0800, "Hoff"
wrote:

This sounds like what I'm looking for too, but I when I follow the
instructions, I get an error: "#NAME?" in the cell.
Any ideas?

"Frank Kabel" wrote:

Hi
a UDF is a user defined function written in VBA (visual Basic for
Applications'). For getting started with this see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Regards
Frank Kabel
Frankfurt, Germany

"Pringles." schrieb im Newsbeitrag
...
sorry to intrude, but... what exactly is a UDF and how do i make one?

"Frank Kabel" wrote:

Hi
use the following UDF:

Function DocProps(prop As String)
application.volatile
On Error GoTo err_value
DocProps = ActiveWorkbook.BuiltinDocumentProperties _
(prop)
Exit Function
err_value:
DocProps = CVErr(xlErrValue)
End Function

and enter in a cell
=DOCPROPS("last save time")
(format cell as date)

--
Regards
Frank Kabel
Frankfurt, Germany

"Ranrunr" schrieb im
Newsbeitrag
...
How do I automatically insert the date the current file was last
modified
into a cell in Excel?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert date in macro George Gee New Users to Excel 12 April 17th 06 05:44 AM
How do I insert the date the file was saved in the MS Excel foote. kacate Excel Discussion (Misc queries) 2 January 31st 05 09:11 PM
Challenging Charting C TO Charts and Charting in Excel 0 January 17th 05 06:57 PM
EXCEL - is there a way to insert "date modified" into Scuda Excel Worksheet Functions 1 January 7th 05 07:52 PM
Modified Date DME New Users to Excel 11 December 14th 04 07:15 PM


All times are GMT +1. The time now is 03:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"