View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_14_] Bob Phillips[_14_] is offline
external usenet poster
 
Posts: 216
Default Logging username, date and time

'-----------------------------------------------------------------
Private Sub Workbook_Open()
'-----------------------------------------------------------------
Dim iRow As Long
Const SH_NAME As String = "Hidden"

With Worksheets(SH_NAME)
iRow = .Cells(.Rows.Count, "A").End(xlUp).Row
If iRow < 1 Or .Range("A1") < "" Then
iRow = iRow + 1
End If
.Cells(iRow, "A").Value = Environ("UserName") & " " & _
Format(Now, "dd/mm/yy hh:mmAM/PM")
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

(remove xxx from email address if mailing direct)

"Maddoktor" wrote in message
...
Hi all,

I know that I have asked this question before but I cannot find the post
so I decided to ask it again.

Could someone please tell me how do I go about recording the username,
date and time the workbook was opened and have this information recorded
continuously starting from A1 row 1 and moving downwards on a hidden
worksheet.

i.e.

A1 Username1 01/01/06 1.00pm
A2 Username2 01/01/06 2.13pm
A3 Username3 06/01/06 5.00am

Thanx in advance.