Never Changing Date

Ric F

Board Regular
Joined
Apr 15, 2011
Messages
117
Office Version
  1. 365
Good afternoon!
I'm trying to figure if there is a way to populate the date that someone enters a value in say column A with today's date, but then that date never changes when someone opens up the filetomorrow or 2 weeks from now to add to the list. so in otherwords - in D2 - IF(A2 >0,{then today's never changing date},"").
Can this be done?

Thanks in advance!!
Ric


1617224305459.png
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

When you enter any value in column (A) todays date will me entered in same row column(D)
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  3/31/2021  5:47:41 PM  EDT
If Target.Column = 1 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Target(, 4).Value = Date
End If
End Sub
 
Upvote 0
Solution
What if I want to put the time stamp in column E?
 
Upvote 0
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  4/1/2021  8:51:39 AM  EDT
If Target.Column = 1 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Target(, 4).Value = Date
Target(, 5).Value = Time

End If
End Sub
 
Upvote 0
Try this if you want to format the time and or date to your specific liking
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  4/1/2021  8:58:29 AM  EDT
If Target.Column = 1 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Target(, 4).Value = Date
Target(, 5).Value = Format(Time, "hh:m:ss")

End If
End Sub
 
Last edited:
Upvote 0
Try this:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  4/1/2021  8:51:39 AM  EDT
If Target.Column = 1 Then
If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
Target(, 4).Value = Date
Target(, 5).Value = Time

End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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