Sample a random calculated cell
Does this do what you want?
Sub GenerateValues(NumberOfTimes As Long, ColumnLocation As Variant, _
StartRow As Long)
Dim X As Long
Const CopyCell As String = "C26"
For X = 1 To NumberOfTimes
Cells(StartRow + X - 1, ColumnLocation).Value = Range(CopyCell)
Application.Calculate
Next
End Sub
Rick
"Diogo" wrote in message ...
Looking at the code I might have been a bit simple in my explainations.
The cell (C26) whose value I want to copy one hundred times is the result of
a sum of several other cells whose values are calculated by the rand
function.
I just want to copy that cell 100 times to a column.
What I need is a automated process that mimics me punchin the F9 button,
going to the C26 cell and copying it to for example column F row 3, and
repeat this process 99 more time so at the end I can see how many values
obtained are grater then a certain value. This I can do manualy, of course.
|