Time stamp a cell based on text entry

GJennin7

New Member
Joined
Oct 7, 2020
Messages
11
Office Version
  1. 365
Platform
  1. Windows
Hi All,
I am trying to time stamp a cell in excel to show the time and date an entry was made. I pulled the below code from the net and modified it with the if statement. It works in the way I want but the issue is when I duplicate it down the column for time stamping each entry all the time entry's are aligning to the last input. Thats to say if someone puts data into row D1 and the code time stamps it to 08:00am then ten minutes later someone puts data into row D2 both times align and show as 08:10. When what I am trying to achieve is D1 = 08:00am and D2=08:10am.

Really appreciate any advise to correct this problem along with an explanation why the code is linking in like this.

=IF(D1="","",TEXT(TODAY(),"d-mmmm-yyyy")&" "& TEXT(NOW(), "h:mm AM/PM"))
=IF(D2="","",TEXT(TODAY(),"d-mmmm-yyyy")&" "& TEXT(NOW(), "h:mm AM/PM"))
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Upvote 0
Hi
You may use this code in sheet code
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Not Intersect(Target, Range("d1:d100")) Is Nothing Then
        With Target.Offset(, -3)
            .Value = .Value
        End With
    End If
End Sub
 
Upvote 0
Thanks for the assist. I checked out the youtube post, the code for which is below. Can you explain the EnableEvents and also when the sub is set up how is it tied into the column

1608642986444.png
 
Upvote 0
Hi, sorry to say I'm not into VBA...

I'm guessing the target column defines the column in which you want the timestamp.
I suspect toggling the events off and on is good practice in handling event specific code, so other events aren't triggered when this code is running.
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,254
Members
448,556
Latest member
peterhess2002

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