print

P

peyman

hi,
How can I have the name of the Computer I'm sending, on the prints?like in
footer?I'm working in a network and I wanna know who is sending prints!
thanx
 
G

Gord Dibben

Sub Footer()
With ActiveSheet
.PageSetup.CenterFooter = Environ("ComputerName") & " " & Now
'or .PageSetup.CenterFooter = Environ("UserName") & " " & Now
End With
End Sub

Enter the above into a General Module in your workbook.

You could also place the code into a BeforePrint event to save manually
running..

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterFooter = Environ("ComputerName") & " " & Now
'or .PageSetup.CenterFooter = Environ("UserName") & " " & Now
End With
End Sub

Enter the above into Thisworkbook module in your workbook.


Gord Dibben MS Excel MVP
 
P

peyman

hi Gord,
thanx for the Codes.I just entered the first code in a module but nothing
happened! should I do anything else?
 
G

Gord Dibben

Assuming you entered the Footer macro in a general module you would then run the
macro.

If still in the Visual Basic Editor, just Alt + q to go back to Excel.

Tools>Macro>Macros.

Select the Footer sub and "Run"

Do a printpreview on the active sheet and see what you have for a footer.

If you need more help on where to enter the different types of code see Ron de
Bruin's site

http://www.rondebruin.nl/code.htm


Gord
 
P

peyman

thanx Gord.got it.

Gord Dibben said:
Assuming you entered the Footer macro in a general module you would then run the
macro.

If still in the Visual Basic Editor, just Alt + q to go back to Excel.

Tools>Macro>Macros.

Select the Footer sub and "Run"

Do a printpreview on the active sheet and see what you have for a footer.

If you need more help on where to enter the different types of code see Ron de
Bruin's site

http://www.rondebruin.nl/code.htm


Gord
 
Top