individual cell date modified will be marked in another cell

CL1000

New Member
Joined
Jul 20, 2019
Messages
6
I have a spreadsheet on Onedrive for me and my employees to keep track of our machine hrs for maintenance. I use Excel 2013 Pro to set it up.

I need to be able to have the date that one cell is modified be enter in another cell to the right of that one.

Say I have column "D",with the machine hrs and column "E" has the date column "D" was modified. I need to have column "E" update automatically when ever a cell in column "D" is modified.

Example: say D5 is modified to 5,567hrs and E5 will automatically log down (todays date) 07/20/2019. D4 was not modified so E4 stills show 07/13/2019 (last date it was modified).

I have tried this formula in cell E5 =IF(D5="",THEN,TODAY()) However when I open the page the next day all cells in column E shows the current days date and not the day it was modified.

Thanks,

CL1000
 

Some videos you may like

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,108
Office Version
2007
Platform
Windows
Put the following code in the events of your sheet.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Count > 1 Then Exit Sub
    If Target.Column = 4 Then Target.Offset(0, 1).Value = Date
End Sub
Sheet event
Right click the tab of the sheet you want this to work, select view code & paste the code into the window that opens up.
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,762
Office Version
2013
Platform
Windows
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
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Modified  7/21/2019  12:58:17 AM  EDT
If Target.Column = 4 Then
    If Target.Cells.CountLarge > 1 Or IsEmpty(Target) Then Exit Sub
    Target(1, 2).Value = Date
End If
End Sub
 

CL1000

New Member
Joined
Jul 20, 2019
Messages
6
Thanks DanteAmor for your reply.

I'm just a basic user of Excel, I know how to do the simple stuff and can figure out some formulas but after that I have not venture out into other areas like the code you posted. Can you expand your answer to walk me through it from the beginning, you know dummies 101 level?

I will need to repeat the formula, code or whatever about 30 times for 30 different rows.

Thanks again,

CL
 

CL1000

New Member
Joined
Jul 20, 2019
Messages
6
Thanks "My Answer is this" for your reply.

I'm just a basic user of Excel, I know how to do the simple stuff and can figure out some formulas but after that I have not venture out into other areas like the code you posted. Can you expand your answer to walk me through it from the beginning, you know dummies 101 level?

I will need to repeat the formula, code or whatever about 30 times for 30 different rows.

Thanks again,

CL
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,762
Office Version
2013
Platform
Windows
You will not need to do as you said:
I will need to repeat the formula, code or whatever about 30 times for 30 different rows.

This script performs the same task for all cells in column 4

When ever you enter any value in column 4 todays date will be entered in column 5

Did you try this script?
 
Last edited:

CL1000

New Member
Joined
Jul 20, 2019
Messages
6
You will not need to do as you said:
I will need to repeat the formula, code or whatever about 30 times for 30 different rows.

This script performs the same task for all cells in column 4

When ever you enter any value in column 4 todays date will be entered in column 5

Did you try this script?
No I have not, Sorry but I'm a total dumby with codes... where and how do I even start with a code?
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,762
Office Version
2013
Platform
Windows
I explained in earlier post but here it is again:
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

Then when you enter any value in column 4 the script runs.
 

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,108
Office Version
2007
Platform
Windows
Thanks DanteAmor for your reply.

I'm just a basic user of Excel, I know how to do the simple stuff and can figure out some formulas but after that I have not venture out into other areas like the code you posted. Can you expand your answer to walk me through it from the beginning, you know dummies 101 level?

I will need to repeat the formula, code or whatever about 30 times for 30 different rows.

Thanks again,

CL
To set the date in the auotmatic and remain permanent it must be with a VBA code. You just put a piece of data in column D and column E is filled in automatically.


HOW TO INSTALL Event Code
------------------------------------
If you are new to event code procedures, they are easy to install. To install it, right-click the name tab at the bottom of the worksheet that is to have the functionality to be provided by the event code and select "View Code" from the popup menu that appears. This will open up the code window for that worksheet. Copy/Paste the event code into that code window. That's it... the code will now operate automatically when its particular event procedure is raised by an action you take on the worksheet itself. Note... if you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,029
Messages
5,484,274
Members
407,436
Latest member
Szafranski

This Week's Hot Topics

  • Finding issue in If elseif else with For each Loop
    Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
  • MsgBox Error
    Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
  • CELL FORMAT - IF CONDITION
    My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
  • Show numbers nearly the same
    Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...
  • Please i need your help to create formula
    I need a formula in cell B8 to do this >>if b1=1 then multiply ( cell b8) by 10% ,if b1=2 multiply by 20%,if=3 multiply by 30%. Thank you in...
  • Got error while adding column and filter
    Got error while adding column and filter In column Z has some like "Success" and "Error". I want to add column in AA if the Z cell value is...
Top