Timestamp vba

RPM7

Board Regular
Joined
Nov 28, 2007
Messages
191
I've got a very basic understanding of VBA & I'm trying to create a spreadsheet with a timestamp along with the username when a cell within a range is modified.

I've have found loads of examples of vba with different variations that're pretty close, but I can't seem to make them work for me.
The closet I've found will add a username and timestamp when cells in a singular column are changed. It offsets the stamp from this target range.

I have information in ranges A2:L34 & A40:L82, & I was hoping to create a stamp in column O & P with the username and time modified respectively.

Does anyone know how to do this?

Any help at all would be greatly appreciated as I'm going in circles.
 
OK, try this.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
  Dim Changed As Range, c As Range
  
  Const myTarget As String = "A1:A10"

  Set Changed = Intersect(Target, Range(myTarget))
  If Not Changed Is Nothing Then
    Application.EnableEvents = False
    For Each c In Changed
      If Len(c.Value) Then
        Cells(c.Row, "G").Value = Now
      End If
    Next c
    Application.EnableEvents = True
  End If
End Sub

How do you define where you want the timestamp? For instance, I would prefer to have it in A4, not next to a certain changed cell.
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Forum statistics

Threads
1,215,417
Messages
6,124,787
Members
449,188
Latest member
Hoffk036

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top