![]() |
Embedding file name in a Cell
Anyone know how to link / write the excel spreadsheet file name into a cell
in the actual spreadsheet? I know you can do it in the header / footer ... that's not what I need. Also, how about the "Last Printed" or "Last Saved" date saved to a cell in the spreadsheet. Thanks, Mark |
Take a look he
http://www.mcgimpsey.com/excel/formu..._function.html In article , "Mark Sowerbutts" wrote: Anyone know how to link / write the excel spreadsheet file name into a cell in the actual spreadsheet? I know you can do it in the header / footer ... that's not what I need. |
You'd need to use VBA. Put these in your workbook code module
Private Sub Workbook_BeforePrint(Cancel As Boolean) With Range("A1") .Value = Date .NumberFormat = "dd mmm yyyy" End With End Sub Private Sub Workbook_BeforeSave( _ ByVal SaveAsUI As Boolean, Cancel As Boolean) With Range("A1") .Value = Date .NumberFormat = "dd mmm yyyy" End With End Sub adjust the range reference as desired. Note that this will put the date in even if the user cancels the save or print. If you're new to macros, see David McRitchie's "Getting Started with Macros": http://www.mvps.org/dmcritchie/excel/getstarted.htm In article , "Mark Sowerbutts" wrote: Also, how about the "Last Printed" or "Last Saved" date saved to a cell in the spreadsheet. |
All times are GMT +1. The time now is 11:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com