Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Can Page Setup values be controlled with VBA?

My Network Administrator where I work asked me if I could put the date that
a worksheet was last changed in the footer of a printout. I don't work with
print settings with VBA at all, so I'm a little unsure here. Similarly, can
this be done in MS Word?

TIA

-gk-



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Can Page Setup values be controlled with VBA?

Using Excel

Put this code in the Thisworkbook code module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.RightFooter = "Document last saved on " & _
Format(ActiveWorkbook.BuiltinDocumentProperties("L ast Save Time"), _
"dd mmm yyyy")
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"TBA" wrote in message
...
My Network Administrator where I work asked me if I could put the date

that
a worksheet was last changed in the footer of a printout. I don't work

with
print settings with VBA at all, so I'm a little unsure here. Similarly,

can
this be done in MS Word?

TIA

-gk-





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 58
Default Can Page Setup values be controlled with VBA?

Beautiful! Thanks Bob!

-gk-

"Bob Phillips" wrote in message
...
Using Excel

Put this code in the Thisworkbook code module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.RightFooter = "Document last saved on " & _
Format(ActiveWorkbook.BuiltinDocumentProperties("L ast Save Time"),

_
"dd mmm yyyy")
End With
End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"TBA" wrote in message
...
My Network Administrator where I work asked me if I could put the date

that
a worksheet was last changed in the footer of a printout. I don't work

with
print settings with VBA at all, so I'm a little unsure here. Similarly,

can
this be done in MS Word?

TIA

-gk-







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
Page layout - page setup - items disabled Bill D - Hubbard & Co Excel Discussion (Misc queries) 6 February 2nd 10 04:34 PM
FORMAT EXCEL WORKBOOK (PAGE SETUP) ALL AT ONCE INSTEAD OF BY PAGE fred Excel Discussion (Misc queries) 1 August 11th 08 04:54 PM
Page Setup when saving a worksheet as a web page pattyw Excel Discussion (Misc queries) 3 July 29th 08 09:25 PM
HOW DO I SETUP A PAGE IN EXCEL TO GIVE TOTALS TO ANOTHER PAGE Randy Excel Worksheet Functions 1 February 8th 07 06:15 PM
Under Page Setup the page option of Ledger - for Office XP Turbo Excel Discussion (Misc queries) 2 September 27th 06 02:46 AM


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