View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default Printing a User

john:
Application.UserName would return the name in the excel properties, which
necessarily wouldn't be the name of who's actually logged in.

i know one of my client's has the same name in all 40 copies of excel.
--


Gary


"John Bundy" (remove) wrote in message
...
On the thisworkbook section of your vba properties place this, change sheet
and hide or not as needed.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim lastCell As Long
lastCell = Sheets("sheet3").Cells(Rows.Count, "A").End(xlUp).Row
Sheets("sheet3").Cells(lastCell + 1, 1) = Application.UserName & ", " & Now()
End Sub

--
-John Northwest11
Please rate when your question is answered to help us and others know what
is helpful.


"Dan" wrote:

When a user prints a spreadsheet I would like to be able to put somewhere on
the page the name of the user that the spreadsheet was printed by. I assume
this is a simple process, but just can't figure it out.