RAND()

G

Guest

I have a formula which calculates different values every time the workbook is
re-calculated, as this formula references a cell which uses the RAND()
function.

Is it possible to capture each value and have it be populated in a separate
table?

I'm assuming that, if possible, this entails using a macro, however, if it
helps, here's the formula in question: =(SUM(D4:E4,A1:C4)*SUM(A1:E4))^D4

B2 contains the RAND() function.
 
B

Bob Phillips

What does B2 have to do with, and how will the formula in question change
just because of a recalculate?

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
D

Dave Peterson

You could log after each calculation. But be aware that there are lots of
calculations that take place while you're changing stuff.

I used a table on Sheet2 and saved the value from A1 of Sheet1. This code goes
in the Sheet1 module:

Option Explicit
Private Sub Worksheet_Calculate()

Dim DestCell As Range
With Worksheets("Sheet2")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

Application.EnableEvents = False
DestCell.Value = Now
DestCell.Offset(0, 1).Value = Me.Range("a1").Value
Application.EnableEvents = True

End Sub
 
G

Guest

B2 is within the range of A1:C4... My question is are you wanting to capture
the value of B2 or the value that the formula is returning or ???. This can
be done but it will require some VBA code triggered from the calculate event
to copy the values over to the new table...
 
G

Guest

This helps, thanks. I'm only interested in capturing 100 or so values, so it
should take too long to calculate.

Dave
 

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