Adding Username and Password facility
To print the username all you need is
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftHeader = Environ("UserName")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
--
HTH
Bob Phillips
"Chris" wrote in message
...
Hi,
I'm not sure if this is possible, but what I want to do is add a username
and password facility to an excel spreadsheet. When the user has logged
in,
if they decide to print the sheet, on the header (or footer), it should
have
the name of the person who logged in.
The purpose is to find out who printed what sheets, and if the sheets are
given out or left on desks, it is possible to see where they came from, so
if
anybody knows a different way, please let me know!
Cheers!
Chris
|