Tehflange
01-28-2014, 09:32 AM
Hi,
Thanks in advance, I'm sure this is doable, I just can't figure it out.
What I am trying to achieve is that on a worksheet, when a user makes a change in column A, column G datestamps the change and column H lists the user.
At the same time, I also want Column B to do the same, but plot the datestamps and username in columns I and J and so on for Columns C, D and E.
I can get the first part to work, with any changes made in A datestamped and username entered in G and F, but then I can't get it to work for B - E.
The code I have cobbled together is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a7:a200")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
With Application
.ScreenUpdating = False
.EnableEvents = False
With Cells(Target.Row, 7)
.Value = Now
.NumberFormat = "dd/mm/yyyy"
End With
.EnableEvents = True
.ScreenUpdating = True
With Cells(Target.Row, 8)
.Value = Environ("username")
End With
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
How can I get this to then do the same for other 4 columns?
Thanks for any help received,
Dan
Thanks in advance, I'm sure this is doable, I just can't figure it out.
What I am trying to achieve is that on a worksheet, when a user makes a change in column A, column G datestamps the change and column H lists the user.
At the same time, I also want Column B to do the same, but plot the datestamps and username in columns I and J and so on for Columns C, D and E.
I can get the first part to work, with any changes made in A datestamped and username entered in G and F, but then I can't get it to work for B - E.
The code I have cobbled together is as follows:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("a7:a200")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
With Application
.ScreenUpdating = False
.EnableEvents = False
With Cells(Target.Row, 7)
.Value = Now
.NumberFormat = "dd/mm/yyyy"
End With
.EnableEvents = True
.ScreenUpdating = True
With Cells(Target.Row, 8)
.Value = Environ("username")
End With
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
How can I get this to then do the same for other 4 columns?
Thanks for any help received,
Dan