![]() |
cell value storage
I need some VBA to read a cell value, let's say on A1 on Sheet1, copy and
paste it on another spreadsheet eg: sheet2 cell A1. This may sound easy, but now, when it changes -this is everytime excel calculates, because is a dependant of a volatile function- I want the output value copied and pasted beneath the previous result on sheet2 on the cell B2, and then B3.... until B65536. I need this to analyze the outputs. Please help! Thanks in advance and greetings, Leo. |
cell value storage
Put the following macro in the worksheet code area:
Private Sub Worksheet_Calculate() n = Sheets("Sheet2").Cells(Rows.Count, "B").End(xlUp).Row v = Sheets("Sheet1").Range("A1").Value If v < Sheets("Sheet2").Cells(n, "B").Value Then Sheets("Sheet2").Cells(n + 1, "B").Value = v End If End Sub Every time the value of A1 in Sheet1 changes because of calculation, the new value will be recorded in column B of Sheet2. This will create a "history" of the values as they change. -- Gary''s Student - gsnu200740 "Leo Rod" wrote: I need some VBA to read a cell value, let's say on A1 on Sheet1, copy and paste it on another spreadsheet eg: sheet2 cell A1. This may sound easy, but now, when it changes -this is everytime excel calculates, because is a dependant of a volatile function- I want the output value copied and pasted beneath the previous result on sheet2 on the cell B2, and then B3.... until B65536. I need this to analyze the outputs. Please help! Thanks in advance and greetings, Leo. |
cell value storage
Student, you're the Master!!
Thanks for this code. Greetigns Leo. "Gary''s Student" wrote in message ... Put the following macro in the worksheet code area: Private Sub Worksheet_Calculate() n = Sheets("Sheet2").Cells(Rows.Count, "B").End(xlUp).Row v = Sheets("Sheet1").Range("A1").Value If v < Sheets("Sheet2").Cells(n, "B").Value Then Sheets("Sheet2").Cells(n + 1, "B").Value = v End If End Sub Every time the value of A1 in Sheet1 changes because of calculation, the new value will be recorded in column B of Sheet2. This will create a "history" of the values as they change. -- Gary''s Student - gsnu200740 "Leo Rod" wrote: I need some VBA to read a cell value, let's say on A1 on Sheet1, copy and paste it on another spreadsheet eg: sheet2 cell A1. This may sound easy, but now, when it changes -this is everytime excel calculates, because is a dependant of a volatile function- I want the output value copied and pasted beneath the previous result on sheet2 on the cell B2, and then B3.... until B65536. I need this to analyze the outputs. Please help! Thanks in advance and greetings, Leo. |
All times are GMT +1. The time now is 02:32 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com