Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default how can one put the name of the user at the footer of a sheet

Guys,

How can we make the footer of a sheet shows the name of the user
automatically once a user opens the workbook. So if somebody else opens it
then the user name will change accordingly.

I had this idea of prompting the user for his/her name and then capturing it
and putting it at the bottom, but other than that can we capture the same
user name the user has used for his microsoft application.

Regards,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default how can one put the name of the user at the footer of a sheet

From VBA, doubleclick the ThisWorkbook module and insert this code:

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

If you would rather not rely on Application.Username, there are API
solutions to finding username:
Do an groups search for GetUserNameA vb api


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Omar" wrote in message
...
Guys,

How can we make the footer of a sheet shows the name of the user
automatically once a user opens the workbook. So if somebody else opens
it
then the user name will change accordingly.

I had this idea of prompting the user for his/her name and then capturing
it
and putting it at the bottom, but other than that can we capture the same
user name the user has used for his microsoft application.

Regards,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default how can one put the name of the user at the footer of a sheet

Thanks,

I will try it and see if it works.

ANyhow thanks,

"Rob van Gelder" wrote:

From VBA, doubleclick the ThisWorkbook module and insert this code:

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

If you would rather not rely on Application.Username, there are API
solutions to finding username:
Do an groups search for GetUserNameA vb api


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"Omar" wrote in message
...
Guys,

How can we make the footer of a sheet shows the name of the user
automatically once a user opens the workbook. So if somebody else opens
it
then the user name will change accordingly.

I had this idea of prompting the user for his/her name and then capturing
it
and putting it at the bottom, but other than that can we capture the same
user name the user has used for his microsoft application.

Regards,




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why does a Multi-sheet/user file open on sheet two every time? Frustrated in NJ Excel Discussion (Misc queries) 1 January 22nd 10 05:46 PM
Adding User Name to footer TinaL Excel Discussion (Misc queries) 0 December 1st 09 03:07 PM
user name in footer Penelope Excel Discussion (Misc queries) 3 November 26th 07 12:21 PM
How to: Excel footer which tells me which user last saved sheet AmandaJane Excel Discussion (Misc queries) 0 June 29th 06 06:48 AM
User name in Footer Brian Allen - McKEOWN INC. Excel Discussion (Misc queries) 8 March 30th 05 09:57 PM


All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"