I have formulas in F15:F1649 that, when auto calc is on, the values refresh every time with a mouse click (e.g., there is a RAND() function in every cell in F15:F1649). I am trying to run a monte carlo simulation that copies the dynamic data in F15:F1649, and pastes it as values to G15:G1649, then copies again and pastes the refreshed data to H15:H1649 and so on until 1000 trials are completed.
I have recorded a macro myself, but the code is pretty sloppy. Please see below for a few example lines of the code:
Sub Monte_Carlo_Sim()
'
' Monte_Carlo_Sim Macro
'
'
Range("F15").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Selection.End(xlUp).Select
Range("G15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("H15").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("I15").Select