Auto Date entry that doesn't change

MCB123x

New Member
Joined
Jun 29, 2020
Messages
38
Office Version
  1. 2007
Platform
  1. Windows
Hello, I'm looking to have data entered into say b1 and have a1(which is where the formula will be) enter todays date. I have used Today() but the day changes along with the day, I need that date to stay the same when the day changes
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
If you are willing to use a short macro then copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet. Enter some data in B1 and press the RETURN key. Today's date will be entered in A1 and will not change unless you change the contents of B1 on a different day.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("B1")) Is Nothing Then Exit Sub
    Range("A1") = Date
    Application.ScreenUpdating = False
End Sub
 
Upvote 0
Ok, thank you. I used that and it works. However, do I have to do that for every cell? There are 71 of them so far, and may increase as time goes on.
 
Upvote 0
What is the range where the date will go and the corresponding range where you will enter the data?
 
Upvote 0
Try:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.CountLarge > 1 Then Exit Sub
    If Intersect(Target, Range("J16:J71")) Is Nothing Then Exit Sub
    Target.Offset(, -1) = Date
    Application.ScreenUpdating = False
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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