Paste this code into the "ThisWorkBook" object in VBA
Private Sub Workbook_Open()
With Sheets("Sheet1")
NxRow = .Cells(65536, 1).End(xlUp).Row + 1
.Cells(NxRow, 1).Value = Module1.GetUserName
.Cells(NxRow, 2).Value = Date
End with
End Sub
Create a MODULE1 and Paste the following code into it :
Option Explicit
' This is used by GetUserName() to find the current user's
' name from the API
Declare Function Get_User_Name Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, _
nSize As Long) As Long
Function GetUserName() As String
Dim lpBuff As String * 25
Get_User_Name lpBuff, 25
GetUserName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
End Function
NOW.... when Workbook is open the persons name will be added to Sheet1 , along with date of opening.