Hi guys,
I have project with Template sheet that will be copied with the same table structure from time to time
The end user will pick one of them and go to log his / her data
I need to specify column in the Template just to read the user GTI and log it automatically after each row update by new entry
I’ve written the below code but apparently it changes the value of the entire usernames column cells every time different user update any cell in Column B
I need it to be smart to change only the last updated row by this specific end user
On the other hand, this one doesn’t work the way I want it to do, I need the following, if the end user update A8 with some value, to update A9 with the GTI username automatically, like the cell underneath, obviously it updates the rest of the cells in the whole column with the GTI value, I need one cell only which is the one under the last cell update
I have project with Template sheet that will be copied with the same table structure from time to time
The end user will pick one of them and go to log his / her data
I need to specify column in the Template just to read the user GTI and log it automatically after each row update by new entry
I’ve written the below code but apparently it changes the value of the entire usernames column cells every time different user update any cell in Column B
I need it to be smart to change only the last updated row by this specific end user
Code:
Dim rw As Range
Sub forEachWs()
For Each rw In ActiveSheet.Rows
If ActiveSheet.Cells(rw.Row, 2).Value <> "" Then
ActiveSheet.Cells(rw.Row, 6).Value = Environ("UserName")
End if
Next rw
End Sub
On the other hand, this one doesn’t work the way I want it to do, I need the following, if the end user update A8 with some value, to update A9 with the GTI username automatically, like the cell underneath, obviously it updates the rest of the cells in the whole column with the GTI value, I need one cell only which is the one under the last cell update
Code:
Dim rw As Range
Sub forEachWs()
For Each rw In ActiveSheet.Rows
If ActiveSheet.Cells(rw.Row, 8).Value <> "" Then
ActiveSheet.Cells(rw.Row + 1, 8).Value = Environ("UserName")
End If
Next rw
End Sub