logon name in footer

M

maryj

I found this code for putting the user name found in Tools, options into the
footer

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.RightFooter = Application.UserName
End Sub

How could this be changed to show the logon name. I tried changing
Application to Environ but that didn't work.

Thanks for your help!!
 
C

Chip Pearson

Try

ActiveSheet.PageSetup.RightFooter = Environ("username")


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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

Top