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- |
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- |
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- |
All times are GMT +1. The time now is 02:53 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com