Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML Data Storage Rookie_User Excel Discussion (Misc queries) 0 June 30th 08 07:11 PM
Data Storage gregory.barrett Excel Discussion (Misc queries) 3 March 30th 06 10:23 PM
Variable Storage gti_jobert[_10_] Excel Programming 3 February 8th 06 11:28 AM
newbie needs help with data storage mrclox Excel Discussion (Misc queries) 0 November 22nd 05 09:52 PM
data storage from one worksheet to another coal_miner Excel Worksheet Functions 3 May 3rd 05 04:42 PM


All times are GMT +1. The time now is 02:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"