Results 1 to 4 of 4

Record date of opening a workbook, together with user name

Threaded View

  1. #1
    Registered User
    Join Date
    08-29-2022
    Location
    Scotland
    MS-Off Ver
    v. 2207 (Build 15427.20210)
    Posts
    1

    Post Record date of opening a workbook, together with user name

    Hi! This is first my post here!

    I am looking to create a template workbook for user acceptance testing (UAT) where I wish to have autopopulated on separate tables of the sheet (please see attached),
    1. the name of the first person (Tester A) opening the sheet and the date+time it was opened by them.
    2. the names and date+time of each person opening (Testers and Users) the sheet at any point of time.

    Is this possible? How does one go about it?

    P.S.: I have no idea about Excel programming as it is rarely, if at all, part of my work/student life, but I shall try my best. I'd appreciate any easier way to go about this that does not involve programming.

    Cheers!

    APPEND: I found this code in the forum here, but I can't get it to work due to the following error: (Error 9: Subscript Out Of Range)

    Option Explicit
    Private iNextRow As Long
    Const HIDDEN_SHEET As String = "Sheet3"
    
    Private Sub Workbook_Open()
    With Worksheets(HIDDEN_SHEET)
    .Range("A1").Value = Environ("UserName")
    .Range("B1").Value = Format(Date + Time, _
    "dd mmm yyyy hh:mm:ss")
    End With
    iNextRow = 2
    
    End Sub
    
    Private Sub Workbook_SheetChange(ByVal Sh As Object, _
    ByVal Target As Range)
    On Error GoTo wb_exit
    Application.EnableEvents = False
    If Sh.Name <> HIDDEN_SHEET Then
    With Worksheets(HIDDEN_SHEET)
    .Range("A" & iNextRow).Value = Environ("UserName")
    .Range("B" & iNextRow).Value = Format(Date + Time, _
    "dd mmm yyyy hh:mm:ss")
    End With
    End If
    
    wb_exit:
    Application.EnableEvents = True
    End Sub
    Attached Files Attached Files
    Last edited by lost_astronaut; 08-29-2022 at 06:10 AM. Reason: Append

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Log/Record every user of a workbook
    By rakotonirinas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2017, 05:41 AM
  2. Opening a workbook already open by another user
    By KASM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2010, 06:47 AM
  3. Only opening a workbook by User Name or Machine Name???
    By Simon Lloyd in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2006, 11:52 AM
  4. [SOLVED] Macro to record user name and date/time
    By Maddoktor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-18-2005, 07:00 AM
  5. [SOLVED] Macro to record user name and date/time
    By Maddoktor in forum Excel General
    Replies: 0
    Last Post: 12-08-2005, 06:10 PM
  6. [SOLVED] Opening workbook in user-defined folder
    By pdberger in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 09:05 AM
  7. Opening a user selected workbook
    By David Hall in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2005, 04:06 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1