Copy, Paste, Calculate loop

tabasco4me

New Member
Joined
Feb 20, 2011
Messages
2
Hello all. First post here --- Hope you can help. :)

- I have a model with 100 scenarios, each scenario is 3 consecutive cells (variables) in a row. Total area for the scenarios is thus: [Sheet 1, A1:C100]

- The first scenario [Sheet 1, A1:C1] needs to be copied, and pasted into [Sheet 2, A1:C3]. Workbook should automatically calculate then. Result cell [Sheet2, D1] should then be copied, and pasted back into [Sheet1, D1].

- Next scenario [Sheet1, A2:C2] should be copied and pasted as above, the result then copied, and pasted in [Sheet 1, D2].

Upon completion of the last (100th) scenario , the process ends.

Thank you for any help!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi. try this

Code:
Sub tobasco()
Dim i As Long
With Sheets("Sheet1")
    For i = 1 To 100
        .Range("A" & i).Resize(, 3).Copy Destination:=Sheets("Sheet2").Range("A1")
        Sheets("Sheet2").Range("D1").Copy Destination:=.Range("D" & i)
    Next i
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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