Fixing time of last update

C

Colin Hayes

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
 
B

Bernard Liengme

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
 
C

Colin Hayes

Bernard Liengme said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top