+ Reply to Thread
Results 1 to 2 of 2

Macro to record User Name and Duration user accessed file.

Hybrid View

bajdr47 Macro to record User Name and... 03-27-2013, 03:56 PM
stnkynts Re: Macro to record User Name... 03-27-2013, 04:14 PM
  1. #1
    Forum Contributor
    Join Date
    03-30-2009
    Location
    dublin
    MS-Off Ver
    Excel 2007
    Posts
    104

    Macro to record User Name and Duration user accessed file.

    Evening Gentlemen,

    Could i please get some assistance, creating a macro to record the User Name and date and time, in the first and second cells of each row that have details entered.


    A B C D E
    1 User Name 22-12-2012 22:10:30 Enter Data Enter Data Enter Data
    2 User Name 22-12-2012 22:11:15 Enter Data Enter Data Enter Data
    3


    Regards

    BAJ

  2. #2
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Macro to record User Name and Duration user accessed file.

    It is not clear how you want this to be triggered so I set it to work when there is a change in column C

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Not Intersect(Target, Columns("C:C")) Is Nothing Then
        Range("A" & Target.Row).Value = Environ$("Username")
        Range("B" & Target.Row).Value = Now
    End If
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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