Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
irfy
 
Posts: n/a
Default How do I print sheet , with actual file save date in footer?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gord Dibben
 
Posts: n/a
Default How do I print sheet , with actual file save date in footer?

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I print sheet , with actual file save date in footer?



"Gord Dibben" wrote:

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I print sheet , with actual file save date in footer?

Very helpful tip thank you! For some reason having trouble getting the date
in the footer to auto refresh without rerunning the macro. Thank you.

"Gord Dibben" wrote:

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I print sheet , with actual file save date in footer?

It will refresh if you use the Before_Print code.

Otherwise you have to run the PathInFooter Sub each time you print.


Gord

On Thu, 5 Jun 2008 10:08:01 -0700, autsumi
wrote:

Very helpful tip thank you! For some reason having trouble getting the date
in the footer to auto refresh without rerunning the macro. Thank you.

"Gord Dibben" wrote:

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:






  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default How do I print sheet , with actual file save date in footer?

Thank you! I also figured out that if you paste the UDF in "This Workbook"
instead of a "Module", then it auto refreshes. Thanks again. Great tip!

"Gord Dibben" wrote:

It will refresh if you use the Before_Print code.

Otherwise you have to run the PathInFooter Sub each time you print.


Gord

On Thu, 5 Jun 2008 10:08:01 -0700, autsumi
wrote:

Very helpful tip thank you! For some reason having trouble getting the date
in the footer to auto refresh without rerunning the macro. Thank you.

"Gord Dibben" wrote:

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How do I print sheet , with actual file save date in footer?

Thisworkbook is where the before_print code is entered.

The UDF and the macro should go into a general module.


Gord

On Tue, 24 Jun 2008 20:29:02 -0700, autsumi
wrote:

Thank you! I also figured out that if you paste the UDF in "This Workbook"
instead of a "Module", then it auto refreshes. Thanks again. Great tip!

"Gord Dibben" wrote:

It will refresh if you use the Before_Print code.

Otherwise you have to run the PathInFooter Sub each time you print.


Gord

On Thu, 5 Jun 2008 10:08:01 -0700, autsumi
wrote:

Very helpful tip thank you! For some reason having trouble getting the date
in the footer to auto refresh without rerunning the macro. Thank you.

"Gord Dibben" wrote:

Add this UDF and macro to your workbook.

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

=DocProps("last author")
or
=DocProps("last save time")
or
-DocProps("creation date")

Sub PathInFooter()
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub

NOTE: the code could be included in a Before_Print routine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = DocProps("last save time")
End Sub


Gord Dibben MS Excel MVP

On Fri, 30 Jun 2006 08:28:01 -0700, irfy wrote:






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
Excel kept on asking to save file every time I jump from one sheet to another! [email protected] Excel Worksheet Functions 8 March 31st 06 03:37 AM
Print Preview---the whole file is blank. Pooja Excel Discussion (Misc queries) 2 March 6th 06 06:23 PM
default save as file type does not work gregf Excel Discussion (Misc queries) 5 February 10th 06 07:50 PM
Can I write an excel formula to display the file save date? Bob-123456789 Excel Worksheet Functions 1 January 26th 06 07:50 PM
Save & Save As features in file menu of Excel Blue Excel Discussion (Misc queries) 9 December 27th 04 08:49 PM


All times are GMT +1. The time now is 05:58 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"