+ Reply to Thread
Results 1 to 2 of 2

VBA to save username when changing source cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    08-02-2016
    Location
    Milwaukee, WI
    MS-Off Ver
    MS Office 365 Version 2307
    Posts
    9

    VBA to save username when changing source cell value

    I have been using the VBA code (posted below) to timestamp when a cell has been changed (in column F of each row) and insert that value in column G. I would now like to also save the USERNAME of the person that has modified that same cell, in column H. can you help modify please?

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Columns("f:f")) Is Nothing Then
    For Each C In Intersect(Target, Columns("f:f"))
    If Not IsEmpty(C) Then
    C.Offset(0, 1).Value = Now
    Else
    C.Offset(0, 1).ClearContents
    End If
    Next C
    End If
    End Sub

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,957

    Re: VBA to save username when changing source cell value

    I don't want to come off as being condescending but this question can be looked up

    Google: VBA username.

    If you need help on where to place it,
    C.Offset(0, 1).Value = Now()
    C.Offset(0, 2).Value =(Environ$("Username"))
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Changing cell source
    By Marvo in forum Excel General
    Replies: 8
    Last Post: 04-11-2016, 06:06 AM
  2. [SOLVED] Save Username to this code
    By Lensmeister in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2015, 10:31 AM
  3. [SOLVED] Changing UserName
    By NeedForExcel in forum Suggestions for Improvement
    Replies: 10
    Last Post: 03-25-2015, 01:01 AM
  4. Write or save username if cell has been changed
    By louvaek in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2014, 03:02 AM
  5. Change Chart Source Data series by changing cell
    By Hendra S in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-10-2014, 02:09 PM
  6. [SOLVED] how to add username to file name on save
    By tinkerbelle in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2012, 03:53 PM
  7. Change external data source depending on username
    By Jack M in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-04-2009, 10:56 AM

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