Hi All,
I have an excel sheet with data as given below
Column A: ID
Column B: Last Modified Date
Column C: Last Modified By
Column D: Last Modified Cell
Column E to Column Z: columns with actual business data
Requirement: If I make changes to value in any cell in a row from Column E through Column Z, I want to be able to print the Last Modified Date, Last Modified By (username), Last Modified Cell (with column alphabet and Row number) in columns B, C, D respectively along that row.
I got the code from another thread for getting the Last Modified Date and Last Modified By. Given code below. I pasted this code in the "View Code" window of that excel sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E2:Z9999")) Is Nothing Then Exit Sub
Cells(Target.Row, "B") = Now()
Cells(Target.Row, "C") = Application.Username
End Sub
This piece of code worked and the columns B and C were populated with the Last Modified Date and Username, when I change the values in any cells from E2 to Z9999
Need Help 1: I do not know how to print the cell details i.e. Last Modified Cell, in column D. For example: If I am changing a value in say cell G12, I want to display the column alphabet and row number details like "G12" in the column D i.e. Last Modified cell. Please help by giving the piece of code for getting this output.
Need Help 2: I am not able to Undo (i.e. do a Ctrl+Z) if I make a change in Column E to Column Z using the macro above. Is there a way to allow Undo? Please help with the code or suggestion regarding Ctrl+z not working
I have an excel sheet with data as given below
Column A: ID
Column B: Last Modified Date
Column C: Last Modified By
Column D: Last Modified Cell
Column E to Column Z: columns with actual business data
Requirement: If I make changes to value in any cell in a row from Column E through Column Z, I want to be able to print the Last Modified Date, Last Modified By (username), Last Modified Cell (with column alphabet and Row number) in columns B, C, D respectively along that row.
I got the code from another thread for getting the Last Modified Date and Last Modified By. Given code below. I pasted this code in the "View Code" window of that excel sheet.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E2:Z9999")) Is Nothing Then Exit Sub
Cells(Target.Row, "B") = Now()
Cells(Target.Row, "C") = Application.Username
End Sub
This piece of code worked and the columns B and C were populated with the Last Modified Date and Username, when I change the values in any cells from E2 to Z9999
Need Help 1: I do not know how to print the cell details i.e. Last Modified Cell, in column D. For example: If I am changing a value in say cell G12, I want to display the column alphabet and row number details like "G12" in the column D i.e. Last Modified cell. Please help by giving the piece of code for getting this output.
Need Help 2: I am not able to Undo (i.e. do a Ctrl+Z) if I make a change in Column E to Column Z using the macro above. Is there a way to allow Undo? Please help with the code or suggestion regarding Ctrl+z not working