cell value storage

L

Leo Rod

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.
 
G

Guest

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.
 

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