Timestamps when cell data changes

lol.xls

Board Regular
Joined
Oct 5, 2009
Messages
174
I have data that will either be entered in F3 or F14. I need some code that will insert a timestamp in L32 if F3 or F14 are edited. Any ideas?
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi lol.xls,

Put this event macro onto the sheet in question:

Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Address = "$F$3" Or Target.Address = "$F$14" Then
        Range("L32").Value = Evaluate("T(""""&TEXT(NOW(), ""ddd d-mmm-yyyy"") & "" "" & LOWER(TEXT(NOW(), ""h:mm.ssAM/PM"")))") 'Date and time stamp
    End If

End Sub

HTH

Robert
 
Upvote 0
Hi lol.xls,

You could put this code in the relevant Sheet:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "F3" Or Target.Address = "F14" Then Range("L32") = Time
End Sub
 
Upvote 0
Neither of those triggered a timestamp to be input into L32. I also left out an important fact out of my original post, In my workbook, when a new report is generated, a value is automatically placed in F3 (which should generate the timestamp), however, the user should have the ability to manually enter a timestamp in F14. So the code i'm working on should automatically assign a timestamp when a report is generated, or mirror the value (if the user enters one) from L14....I may be way over complicating this. Sorry.
 
Upvote 0
Trebor, I did get your code to work as you sent it, but i had to change the Change event to:
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
 
Upvote 0
Hi lol.xls,

I redid it and it works for me with the $ signs:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$F$3" Or Target.Address = "$F$14" Then Range("L32") = Time
End Sub

Trebor's code and mine are essentially the same - you shouldn't need the SelectionChange - just the change is far less tricky!
 
Upvote 0
Ok,

This looks like it might work for my application, but I have to do this to many cells. I would like to have a range of cells that create a time stamp on corresponding cells in another worksheet when data is entered. Any ideas?
 
Upvote 0
Ok,

This looks like it might work for my application, but I have to do this to many cells. I would like to have a range of cells that create a time stamp on corresponding cells in another worksheet when data is entered. Any ideas?


You could just test for the column (or) row of the target - can you be more specific??
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,989
Members
452,541
Latest member
haasro02

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