View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
mike_vr mike_vr is offline
external usenet poster
 
Posts: 42
Default Worksheet name in footer

Spot on, thank you very much!!

"Niek Otten" wrote:

&[Tab]

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"mike_vr" wrote in message ...
| Hi Bob,
|
| Thanks for that, but unfortunately not exactly what I'm after - sorry,
| should have been clearer!!
|
| I've got a macro that inserts the path, worksheet, filename. However, I've
| found that the problem with this is that once it's in, it doesn't update if I
| save the book as a new book or update the worksheet name. I.e. it takes a
| snapshot of what the file is and inserts it as a footer, but when I save to a
| new month it doesn't update unless I run the macro again.
|
| I have noticed though that the &[path] and &[File] methods do update when
| saved as a new workbook so was hoping that there would be a similar way of
| adding the worksheet name.
|
| Any thoughts?
|
| Thanks,
|
| Mike
|
| "Bob Phillips" wrote:
|
| Private Sub Workbook_BeforePrint(Cancel As Boolean)
| With ActiveSheet
| .PageSetup.LeftFooter = .Name
| End With
| End Sub
|
| 'This is workbook event code.
| 'To input this code, right click on the Excel icon on the worksheet
| '(or next to the File menu if you maximise your workbooks),
| 'select View Code from the menu, and paste the code
|
|
| --
| HTH
|
| Bob
|
| (there's no email, no snail mail, but somewhere should be gmail in my addy)
|
| "mike_vr" wrote in message
| ...
| Hi all,
|
| Relatively simple one I hope. Trying to insert a footer that automatically
| updates to the name of the current worksheet. I've got &[Path] to show the
| directory, &[File] to show the file name, but what would be the short way
| to
| get the worksheet name in the footer? &[???]
|
| Thanks in advance,
|
| Mike
|
|
|