View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Hank Scorpio
 
Posts: n/a
Default Username & Date/Time Stamp

On 18 Mar 2006 15:54:16 -0800, "Ken D" wrote:

I've created the following code to record Username and a Date/Time
Stamp in cells K1 & L1 (respectively) after a user makes any change to
a cell in the same row (A1 through J1).

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A1:J1"), Target) Is Nothing Then Exit Sub
Range("K1").Formula = Format(User())
Range("L1").Formula = Format(Now(), "dd-mmm-yyyy hh:mm:ss am/pm")
End Sub

I need to repeat this code for approx 50 rows. Any advice on the most
efficient way to handle this is greatly appreciated.


If I understand you correctly, you could modify something like this:

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Row 50 Or Target.Column 10 Then Exit Sub

Cells(Target.Row, 11).Formula = Format(Application.UserName)

Cells(Target.Row, 12).Formula = Format(Now(), "dd-mmm-yyyy
hh:mm:ss am/pm")

End Sub

---------------------------------------------------------
Hank Scorpio
scorpionet who hates spam is at iprimus.com.au (You know what to do.)
* Please keep all replies in this Newsgroup. Thanks! *