Header/Footer field for User?

  • Thread starter Thread starter Minh Phan
  • Start date Start date
M

Minh Phan

Hello,

I would like to set up a template that will have a
footer : Prepared by [User]

where [User] is the Excel User Name variable. I need this
since I would like the template to work for many people.

Does anyone know how this can be done? Thanks in advance!

Minh
 
Minh,

Try placing this code in the ThisWorkbook module....

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.LeftFooter = "Prepared by " _
& CreateObject("WScript.Network").UserName
End Sub

--
XL2002
Regards

William

(e-mail address removed)

| Hello,
|
| I would like to set up a template that will have a
| footer : Prepared by [User]
|
| where [User] is the Excel User Name variable. I need this
| since I would like the template to work for many people.
|
| Does anyone know how this can be done? Thanks in advance!
|
| Minh
 
Back
Top