Forum Discussion
Emil Larsson
Jan 13, 2018Copper Contributor
Saving updated cell values in new cells before it refreshes.
Saving updated cell values in new cells before it refreshes.
I have a spreadsheet that updates values in specific cells taken from the web, every hour, using web query. I want to be able to save ...
- Jan 16, 20181. Make sure Excel calculates when cell A5 changes by placing a formula like =A5 in any cell on that sheet
2. Right-click the sheet's tab and choose "View code"
3. paste this code:
Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Me.Range("M" & Me.Rows.Count).End(xlUp).Offset(1).Value = Me.Range("A5").Value
Application.EnableEvents = True
End Sub
Mind you, this also will copy the value of cell A5 if you manually hit F9 or if something else causes a calculation in our file.
Emil Larsson
Copper Contributor
Thanks! Worked flawlessly! :D
JKPieterse
Jan 17, 2018Silver Contributor
You're welcome!