Have one cell check whenever data in another cell changes for entire column

David77

Board Regular
Joined
Jun 24, 2020
Messages
109
Office Version
  1. 365
Platform
  1. Windows
Hello everybody,

I am currently managing a database full of stock quantities, here:



Is there any way (I imagine some VBA coding) in which I can create a column 3 rows to the right of this one (row L in this case), where every single cell in row L would count the last time (in date, so for example: 05-08-2020 15:11) that the number in row I changed?

I want to do this to keep a check of my quantity and see if some of it doesn't move for longer periods of time (such as 3 months or more for example)

On top of this it would also be amazing if I could somehow create some sort of conditional formatting in row L, so whenever the date is more than 3 months old from the current date it turns to a red fill in the background - if this is possible too?

If anybody can help me create this it would be absolutely amazing! Thank you so much everybody :)

Best regards,
David
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Select the range in column L where you want to place the conditional formatting and use this formula: =AND(L2<>"",L2<NOW()-90)
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. Change a value in column I and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("I:I")) Is Nothing Then Exit Sub
    Target.Offset(, 3) = Now()
End Sub
 
Upvote 0
Select the range in column L where you want to place the conditional formatting and use this formula: =AND(L2<>"",L2<NOW()-90)
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. Change a value in column I and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("I:I")) Is Nothing Then Exit Sub
    Target.Offset(, 3) = Now()
End Sub
Hello Mumps,

Thank you so very much!

Unfortunately, I am currently getting this error from your formula for some reason?

1597127647049.png
 
Upvote 0
Please see the attached Excel file in this link: Documents. It has the exact same data as my main file. Quantity, two columns where I have added a macro that lets you enter numbers, which is then automatically added/subtracted from the quantity and finally the column that I am seeking assistance with: The one showing the last date on which the quantity changed.

NOTE: Please note that since it is an online Excel file my macro does not work (for some reason) so the macro that lets it subtract and add does not work.

Can you assist me with this? Thank you so much! :)

Best regards,

David

Select the range in column L where you want to place the conditional formatting and use this formula: =AND(L2<>"",L2<NOW()-90)
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. Change a value in column I and press the RETURN key.
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("I:I")) Is Nothing Then Exit Sub
    Target.Offset(, 3) = Now()
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,976
Messages
6,122,543
Members
449,089
Latest member
davidcom

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