+ Reply to Thread
Results 1 to 7 of 7

Record the user ID when entering Data in row.

Hybrid View

bajdr47 Record the user ID when... 10-21-2012, 05:26 PM
adam2308 Re: Record the user ID when... 10-21-2012, 05:45 PM
bajdr47 Re: Record the user ID when... 10-21-2012, 05:52 PM
adam2308 Re: Record the user ID when... 10-21-2012, 05:50 PM
HSV Re: Record the user ID when... 10-21-2012, 05:51 PM
HSV Re: Record the user ID when... 10-21-2012, 06:04 PM
bajdr47 Re: Record the user ID when... 10-21-2012, 06:08 PM
  1. #1
    Forum Contributor
    Join Date
    03-30-2009
    Location
    dublin
    MS-Off Ver
    Excel 2007
    Posts
    104

    Record the user ID when entering Data in row.

    Evening All,

    I have little knowledge of VBA, and can sometimes edit code but find it difficult to create from scratch.

    My problem i need code to record in the first cell of every row (col A) the user name of the person recording (entering) the Data.

    Thank you in Advance

    Baj

  2. #2
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Record the user ID when entering Data in row.

    I take it you mean the first empty cell of each row in column A?

  3. #3
    Forum Contributor
    Join Date
    03-30-2009
    Location
    dublin
    MS-Off Ver
    Excel 2007
    Posts
    104

    Re: Record the user ID when entering Data in row.

    the first cell that the user will be allowed to enter data will be Col B, i hope to leave Col A hidden to facilitate the recording of data in each row and the User Id in the first cell (automated)

  4. #4
    Forum Contributor
    Join Date
    02-20-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    467

    Re: Record the user ID when entering Data in row.

    Assuming that is what you mean. Try this
    Worksheets("Sheet1").Range("A" & Rows.Count).End(xlUp).Offset(1, 0) = Environ$("username")

  5. #5
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Record the user ID when entering Data in row.

    Like this?

    Two options:
    1). Application.username
    2). Environ("Username")

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
     Cells(Rows.Count, 1).End(xlUp).Offset(1) = Application.UserName 
    Application.EnableEvents = True
    End Sub
    Harry.

  6. #6
    Valued Forum Contributor
    Join Date
    02-12-2011
    Location
    The Netherlands
    MS-Off Ver
    365
    Posts
    860

    Re: Record the user ID when entering Data in row.

    Try.
    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
     If Target.Column = 1 Then
      MsgBox "the first cell that the user will be allowed to enter data will be Col B", vbExclamation, "Warning"
       Target.ClearContents
    Else
       Cells(Rows.Count, 1).End(xlUp).Offset(1) = Application.UserName 'or Environ("Username")
      End If
    Application.EnableEvents = True
    End Sub

  7. #7
    Forum Contributor
    Join Date
    03-30-2009
    Location
    dublin
    MS-Off Ver
    Excel 2007
    Posts
    104

    Re: Record the user ID when entering Data in row.

    Gentlemen,

    i have to apologies, but i have to log off. i will return tomorrow evening.

    i will test your responses as soon as i can


    Kind Regards

    Baj

+ 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