ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   inserting current windows user id into a cell (https://www.excelbanter.com/excel-worksheet-functions/248426-inserting-current-windows-user-id-into-cell.html)

MartyMack74

inserting current windows user id into a cell
 
Does anyone know of a function or macro that will allow the current windows
userid to be displayed in a cell such as: "Printed by: userid"? Any help is
greatly appreciated.

Mike H

inserting current windows user id into a cell
 
Hi,

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Sheets("Sheet1").Range("A1") = "Printed by " & Environ("Username")
End Sub

Mike

"MartyMack74" wrote:

Does anyone know of a function or macro that will allow the current windows
userid to be displayed in a cell such as: "Printed by: userid"? Any help is
greatly appreciated.


Ron Rosenfeld

inserting current windows user id into a cell
 
On Fri, 13 Nov 2009 14:37:25 -0800, Gord Dibben <gorddibbATshawDOTca wrote:

Ron

This is not Windows UserID

Environ("UserName") is login name.


Gord


Thanks for pointing that out.
--ron


All times are GMT +1. The time now is 05:16 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com