Timestamp cell change

Jayzon

New Member
Joined
Feb 17, 2013
Messages
34
Office Version
  1. 365
Platform
  1. Windows
Hi
I have a range of cells C2-G2 and if X is entered into any of these cells i would like O2 to timestamp the event.

And timestamp updated if X is entered into another of these cells.

Is this possible with a formula ?

Thank you in advance.
Jayzon
 
Last edited:

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi
I have a range of cells C2-G2 and if X is entered into any of these cells i would like O2 to timestamp the event.

And timestamp updated if X is entered into another of these cells.

Is this possible with a formula ?

Thank you in advance.
Jayzon
Not with formula, as with formula would use NOW() which returns current date and time. The problem is, that is not frozen in time and is constantly updating.
You would use automated VBA code do this. Are you open to a VBA solution? We would give you the code, and it would just be "plug-and-play".
 
Upvote 0
Not with formula, as with formula would use NOW() which returns current date and time. The problem is, that is not frozen in time and is constantly updating.
You would use automated VBA code do this. Are you open to a VBA solution? We would give you the code, and it would just be "plug-and-play".
Yes i am open to a VBA solution, if i can expand as needed to add more rows like C3-G3 and C4-G4 adding a stamp to O3 or O4 and so on.
 
Upvote 0
OK, here is code that would work on row 2-100. You can adjust your ending row number however you like.

In order for this code to run automatically, it must be placed in the proper sheet module. One easy way to ensure this is to go to the sheet you wish to run this against, right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the VB Editor window that pops up. Then save and close that window.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Exit if multiple cells updated at once
    If Target.CountLarge > 1 Then Exit Sub
   
'   See if a cell is updated in range C2:G100
    If Not Intersect(Target, Range("C2:G100")) Is Nothing Then
'       See if updated value in "X"
        If UCase(Target.Value) = "X" Then
'           Add time stamp to column O
            Cells(Target.Row, "O").Value = Now()
        End If
    End If
   
End Sub
Now, whenever you enter "X" or "x" anywhere in C2:G100, it will automatically add a date/time stamp to column O of that row.
 
Last edited:
Upvote 1
Solution
OK, here is code that would work on row 2-100. You can adjust your ending row number however you like.

In order for this code to run automatically, it must be placed in the proper sheet module. One easy way to ensure this is to go to the sheet you wish to run this against, right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this code in the VB Editor window that pops up. Then save and close that window.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'   Exit if multiple cells updated at once
    If Target.CountLarge > 1 Then Exit Sub
   
'   See if a cell is updated in range C2:G100
    If Not Intersect(Target, Range("C2:G100")) Is Nothing Then
'       See if updated value in "X"
        If UCase(Target.Value) = "X" Then
'           Add time stamp to O2
            Cells(Target.Row, "O").Value = Now()
        End If
    End If
   
End Sub
Now, whenever you enter "X" or "x" anywhere in C2:G100, it will automatically add a date/time stamp to column O of that row.
Works like a charm, thank you very much :)
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,215,137
Messages
6,123,254
Members
449,093
Latest member
Vincent Khandagale

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