I need help with automatic last updated cell

juden1

New Member
Joined
Aug 13, 2019
Messages
3
Hey!

I had this VBA code working until i put a formula in in J15 in the "Data" workbook.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("J15")) Is Nothing Then Exit Sub
Range("K18") = Now()
End Sub



My plan is to paste the data from A1 in "hej.xlsm" to J15 in "Data.xlsm" based on current date. And in K18 in "Data.xlsm" i want to see when the value in the J15 cell was last changed or updated. As i mentioned, as soon as a formula changes the cells value it stopped working.

Any ideas?
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
When a formula cell updates, VBA does not see that change as a Worksheet_change event so your change event code is not triggered. You could use a Workbook_SheetCalculate event so that each time the sheet calculates and your formula cell updates you put a time stamp in the cell of your choice. Alternatively, you may be able to use a non-formulaic cell that is a precedent cell to the formula cell to trigger the worksheet_change event code.
 
Upvote 0
When a formula cell updates, VBA does not see that change as a Worksheet_change event so your change event code is not triggered. You could use a Workbook_SheetCalculate event so that each time the sheet calculates and your formula cell updates you put a time stamp in the cell of your choice. Alternatively, you may be able to use a non-formulaic cell that is a precedent cell to the formula cell to trigger the worksheet_change event code.

Oh right, SheetCalculate. Would you help me how it would look like instead? Im kind of new to VBA and Excel..
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
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