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

  • Thread starter Thread starter Dante
  • Start date Start date
D

Dante

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
 
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
 
Frank Kabel said:
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
 
Hi
then isert this in a new workbook. save this workbook as template
(*.xlt file9 and use this template for your future workbooks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top