Printing Footer

W

Wahab

Hi
I have created one Excel file, I wnat to take credit for
that one. What I want is I want to write code in VBA in
such a way that, somebody print any sheet or any part
form this file in the footer my name will come. If some
one is adding the sheet or changing the name of sheet
still it will print my name in footer.

Thanks to all in advance
Wahab
 
W

William

Hi Wahab

Place the following code in the "ThisWorkbook" module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In Worksheets
ws.PageSetup.CenterFooter = "File Created by Wahab"
Next ws
End Sub

--
XL2002
Regards

William

[email protected]

| Hi
| I have created one Excel file, I wnat to take credit for
| that one. What I want is I want to write code in VBA in
| such a way that, somebody print any sheet or any part
| form this file in the footer my name will come. If some
| one is adding the sheet or changing the name of sheet
| still it will print my name in footer.
|
| Thanks to all in advance
| Wahab
|
 
G

Guest

-----Original Message-----
Hi Wahab

Place the following code in the "ThisWorkbook" module.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In Worksheets
ws.PageSetup.CenterFooter = "File Created by Wahab"
Next ws
End Sub

--
XL2002
Regards

William

[email protected]

| Hi
| I have created one Excel file, I wnat to take credit for
| that one. What I want is I want to write code in VBA in
| such a way that, somebody print any sheet or any part
| form this file in the footer my name will come. If some
| one is adding the sheet or changing the name of sheet
| still it will print my name in footer.
|
| Thanks to all in advance
| Wahab
|


.
It's well done,Thank you very much.
Wahab
 
Top