View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
marcus[_3_] marcus[_3_] is offline
external usenet poster
 
Posts: 140
Default Writing Data to an External File

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