ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Print "ActiveWorkbook.FullName" always.....but (https://www.excelbanter.com/excel-programming/317687-print-activeworkbook-fullname-always-but.html)

Dante

Print "ActiveWorkbook.FullName" always.....but
 
Hi from italy.....
so sorry for my bad english...:)

I try to explain what I search :

I want that the code under work always , with all workbook (past and future)
:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
WS.PageSetup.LeftHeader = ActiveWorkbook.FullName
Next WS
End Sub

where to put it ???

but i search also the code for print some sheet (If I want) without the
"header"
simply push a botton on menu-bar.


can you hel me ?

TIA



Frank Kabel

Print "ActiveWorkbook.FullName" always.....but
 
Hi
this has to go in your workbook module:
- open your file
- hit ALT+F11 to open the VBA Editor
- locate in the left window your project and double click on the item
'ThisWorkbook'
- paste the code in this module
- close the VBA Editor, save the file and try it

--
Regards
Frank Kabel
Frankfurt, Germany

"Dante" schrieb im
Newsbeitrag ...
Hi from italy.....
so sorry for my bad english...:)

I try to explain what I search :

I want that the code under work always , with all workbook (past and

future)
:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim WS As Worksheet
For Each WS In ActiveWorkbook.Worksheets
WS.PageSetup.LeftHeader = ActiveWorkbook.FullName
Next WS
End Sub

where to put it ???

but i search also the code for print some sheet (If I want) without

the
"header"
simply push a botton on menu-bar.


can you hel me ?

TIA




Dante

Print "ActiveWorkbook.FullName" always.....but
 

"Frank Kabel" ha scritto nel messaggio
...
Hi
this has to go in your workbook module:
- open your file
- hit ALT+F11 to open the VBA Editor
- locate in the left window your project and double click on the item
'ThisWorkbook'
- paste the code in this module
- close the VBA Editor, save the file and try it


hi
i want it work in *all* workbook (past e future) .
is possible ?
thk for reply



Frank Kabel

Print "ActiveWorkbook.FullName" always.....but
 
Hi
then isert this in a new workbook. save this workbook as template
(*.xlt file9 and use this template for your future workbooks

--
Regards
Frank Kabel
Frankfurt, Germany

"Dante" schrieb im
Newsbeitrag ...

"Frank Kabel" ha scritto nel messaggio
...
Hi
this has to go in your workbook module:
- open your file
- hit ALT+F11 to open the VBA Editor
- locate in the left window your project and double click on the

item
'ThisWorkbook'
- paste the code in this module
- close the VBA Editor, save the file and try it


hi
i want it work in *all* workbook (past e future) .
is possible ?
thk for reply





All times are GMT +1. The time now is 12:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com