ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Fixing time of last update (https://www.excelbanter.com/excel-worksheet-functions/254476-fixing-time-last-update.html)

Colin Hayes

Fixing time of last update
 

HI

I have a small problem that I'm hoping someone can help with.

I use the 'Refresh All' function in Excel to update some figures in my
worksheet.

The cells affected by the update are D4 - F6

I'd like in cell D10 to insert the time of the last update.


Can someone advise how to do this?



Grateful for any advice.



Best Wishes

Bernard Liengme[_2_]

Fixing time of last update
 
I am not familiar with "refresh all" so my subroutine may not work for you.
When I use another subroutine to change D4's value, the Worksheet_change sub
below, enters a time value in D10.
This sub must be placed in sheet module: right click the tab of the sheet
involved; use View Code and copy and paste the sub to there.

Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("D4").Address Then
Range("D10") = Format(Now, "H:mm")
End If
End Sub

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"Colin Hayes" wrote in message
...

HI

I have a small problem that I'm hoping someone can help with.

I use the 'Refresh All' function in Excel to update some figures in my
worksheet.

The cells affected by the update are D4 - F6

I'd like in cell D10 to insert the time of the last update.


Can someone advise how to do this?



Grateful for any advice.



Best Wishes



Colin Hayes

Fixing time of last update
 
In article , Bernard Liengme
writes
I am not familiar with "refresh all" so my subroutine may not work for you.
When I use another subroutine to change D4's value, the Worksheet_change sub
below, enters a time value in D10.
This sub must be placed in sheet module: right click the tab of the sheet
involved; use View Code and copy and paste the sub to there.

Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = Range("D4").Address Then
Range("D10") = Format(Now, "H:mm")
End If
End Sub

best wishes


Hi Bernard

OK Thanks for getting back.

I couldn't get the routine to work unfortunately , although I can see
the aim.

I think that if it finds a change in any of the cells A4 to F6 , then
updating the time in D10 would do the trick.

Thanks again.




All times are GMT +1. The time now is 06:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com