Copy simulation results with macro

johanna1128

New Member
Joined
May 15, 2016
Messages
2
I'am trying to place a macro code to copy Monte Carlo simulation results from a "results" sheet to the "simulation results" sheet. I browsed plenty of forums and solutions bit my macro is still not working as I want.

This is my last version that is work but tt copies and paste values only to the from result sheet B3:C3 to the simulation results sheet B7:C7 cells. In turn, it shoud copy all 100 values and paste them under each other.

Index = 0
Do While Index <= 100
Sheets("result").Range("B3:C3").Copy
Sheets("simulation results").Range("B7:C7").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Index = Index + 1
Loop

I really do not know what else can I put in it to work as I want and I would really appreciate if anyone could help me. Thanks!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
do you ponly need to pick up B3:C3


will it always be B7:C7 or does it need to progess down the sheet

what is index supposed to do
 
Upvote 0
do you ponly need to pick up B3:C3


will it always be B7:C7 or does it need to progess down the sheet

what is index supposed to do


Yes, I picking up only from the B3:C3 cells of the result sheet, because these values are changing az number of iterations goes. And I want to paste these different results under each other on the simulation results sheet.

The index is for the iteration.
 
Upvote 0
Code:
Dim LR as long
LR = Sheets("simulation results").Range("B65536").End(xlup).row
Sheet("result").Range("B3:C3").Copy Destination:=Sheets("simulation results").Range("B" & LR & ":C" & LR)

That instead of Index (for next might work for you)
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,938
Members
449,197
Latest member
k_bs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top