View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Souny Souny is offline
external usenet poster
 
Posts: 40
Default Writing Data to an External File

Marcus,

Thanks for responding to my message. I have not tried your code yet. I
will let you know after I try it. Thanks.

"marcus" wrote:

Souny

The first part of the procedure to capture the user name is thus.
Place this code in a normal module.

Option Explicit
Function UserNameOffice() As String
UserNameOffice = Application.UserName
End Function

In the Workbook module place the following code.

Option Explicit

Private Sub Workbook_Open()
Worksheets("Sheet1").Cells(1, 1).Value = "=UserNameOffice()"
Worksheets("Sheet1").Cells(1, 2).Value = Date & Time

End Sub

Upon open it will place the user name and date and time in A1 and B1
respectively.

Take care

Marcus

.