Logging username, date and time
Thanx Bob ... worked perfectly.
Maybe you could help me to expand it even further and I am not sure if I
should start another thread.
My workbook has 5 worksheets. The first three worksheets are designed as
individual menus/links to other worksheets that are hidden. i.e. one
worksheet is the menu options for finance, one for marketing, one for
design. I would like for one of the three individual menus (worksheets)
to be displayed depending on the username of whom opens the workbook.
i.e. if user AB opens the workbook, then the finance menu (worksheet) is
displayed that has links to the finance worksheets (that were hidden)
and then for these hidden worksheets to be displayed.
Is this at all possible?
Maddoktor
Bob Phillips wrote:
'-----------------------------------------------------------------
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")
.Cells(iRow, "B").Value =Format(Date, "dd/mm/yy")
.Cells(iRow, "C").Value = Format(Time, "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
|