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

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,207
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,207
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,645
Messages
5,488,077
Members
407,623
Latest member
Deigs

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top