Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default worksheet change event auto populate

-Hello,

I would like to add a worksheet change event that will populate specific
cells with the current system date and user name when the corresponding row
is updated. There are two of us tracking a large amount of data and I want to
be able to know who changed data in that row and on what date. I think this
is pretty easy but I am still a novice.

Thank you,
Nelly
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default worksheet change event auto populate

The code below will put the username in column J and date/time stamp in
column K of the modified rows.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Integer
Application.EnableEvents = False
For i = 0 To Target.Rows.Count - 1
Me.Cells(Target.Row + i, 10).Value = Environ("username")
Me.Cells(Target.Row + i, 11).Value = Now
Next i
Application.EnableEvents = True
End Sub


--
Hope that helps.

Vergel Adriano


"Nelly" wrote:

-Hello,

I would like to add a worksheet change event that will populate specific
cells with the current system date and user name when the corresponding row
is updated. There are two of us tracking a large amount of data and I want to
be able to know who changed data in that row and on what date. I think this
is pretty easy but I am still a novice.

Thank you,
Nelly

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default worksheet change event auto populate

Private Sub Worksheet_Change(ByVal Target As Range)
n = Target.Row
Application.EnableEvents = False

Cells(n, 1).Value = Environ("UserName")
Cells(n, 2).Value = Now()

Application.EnableEvents = True
End Sub

will record the username and date in columns A&B of the changed row.

NOTE: this is event code and goes in worksheet code area.
--
Gary''s Student
gsnu200711

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to auto populate an invoice from data in an existing worksheet juliebythesea Excel Discussion (Misc queries) 5 October 28th 09 08:14 AM
Worksheet formula - auto populate Brent Excel Worksheet Functions 4 April 5th 09 09:22 PM
Auto populate one worksheet from other worksheets mab1963 Excel Worksheet Functions 4 February 29th 08 03:21 PM
I want to conditionally auto-populate a summary worksheet trigger Excel Discussion (Misc queries) 0 January 13th 06 03:30 PM


All times are GMT +1. The time now is 02:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"