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
 

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