Forum Discussion

Doug Jones's avatar
Doug Jones
Copper Contributor
Feb 21, 2018

How do i has a cell auto populate the last author if a cretin row is edited?

As of now, I am using the following code and it is not working for some reason... I need Volume K to auto-populate with the last author and date and time starting in Row 9. So if I modify anything in row 9 Collum K Row 9 will auto input last author and date and time. continuing,  if I modify something in row 10 K10 will auto input last author and date and time...etc

 

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row > 1 Then Cells(Target.Row, "B") = LastAuthor()
End Sub

 

thanks! 

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver Contributor

    Hi Doug,

     

    This code is applied to column B starting from row 2.

    If you want to apply it to column K starting from row 9, then replace it with this:

     

    Private Sub Worksheet_Change(ByVal Target As Range)
         If Target.Row > 8 Then Cells(Target.Row, "K") = LastAuthor()
    End Sub

     

     

    • Doug Jones's avatar
      Doug Jones
      Copper Contributor

      I am not too smart with excel and for some reason still cannot get this to work. I have attached my file maybe you can see what I am doing wrong? 

      What I am trying to do is anytime someone modifies a cell in a row Cell L for that row auto collects the username and date row was last modified. 

      • Haytham Amairah's avatar
        Haytham Amairah
        Silver Contributor

        I have assumed that you have a function called in the code!

        The function is LastAuthor().

        I'm not sure that you really have this function or it's just an example!

        You may need something different, and I cannot figure it out!

Resources