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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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