Log file where each line gets a date stamp when populated and where date is then stored as value

pluginguin

New Member
Joined
Aug 10, 2016
Messages
21
Office Version
  1. 2019
Platform
  1. Windows
I have a simple log file with a couple of columns to log events. One row for each event.
Every cell in a row is manually entered and there are no macro's or formula's yet.
To prevent mistakes I now want to make a modification in column A... the date column.
As soon as one of the other cells in the row is populated I want the cell in column A to be populated with the date of today.
This can be achieved with a formula. But here is the challenge:

Once the row is populated and the date stamp is there, I want to change the date into a normal date value, so it doesn't change anymore if cells are emptied again or the file is reopened.
The rest of the column should still have the formula in place for future events.

I can find many posts about date formulas and worksheet change by value code but nothing where these two requests are bundled and comprehensive.

Can someone help me out please?

Thanks in advance
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cel as Range
Application.EnableEvents = False
For Each cel In Intersect([A:A], Target.EntireRow)
    If Len(cel) = 0 Then cel = Date
Next
Application.EnableEvents = True
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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