Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet name in footer
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 |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet name in footer
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 |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet name in footer
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 |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Worksheet name in footer
&[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 | | | |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 | | | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Different font in footer on first worksheet than the others | Excel Discussion (Misc queries) | |||
how to include a variable in the header and/or footer of a worksheet | Excel Discussion (Misc queries) | |||
hyperlinking worksheet info to the footer | Excel Discussion (Misc queries) | |||
Can I put a footer in Excel on first page of a worksheet only. | Excel Discussion (Misc queries) | |||
How can I insert a value from an Excel Worksheet into a footer? | Excel Discussion (Misc queries) |